cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: nonportable C (ftp remembers wrong prevpath)

From: Jamie Lokier <jamie_at_shareable.org>
Date: Fri, 25 Nov 2005 20:39:28 +0000

Bryan Henderson wrote:
> > 1 - The code MUST be portable enough (no C++ comments, no mixing variable
> > declarations with code etc)
>
> The implication here is that the code in question mixes variable
> declaration with code in this nonportable way, so I'd like to point
> out that it doesn't. (I'm not the person who posted the code, but I
> do write code like this when given the choice).

Fwiw, current GCCs have the option -Wdeclaration-after-statement which
is handy to catch this when it does happen for real. My own
autoconf'd program adds it to CFLAGS, when using a GCC that accepts it.

-- Jamie
Received on 2005-11-25