Tony Balinski wrote:
> Quoting Andrew Hood <[EMAIL PROTECTED]>:
> 
> 
>>Andrew Hood wrote:
> 
> 
>>I now have a minimal set of changes against CVS HEAD ( hopefully
>>available from http://andyhood.net/cvs-2007-10-28-11-43-17UTC.diff.gz )
>>allowing nedit to compile with
>>
>>CC=gcc -Wuninitialized -Wall -W -Werror -D_U_='__attribute((unused))'

Oops typo.  -D_U_='__attribute__((unused))'

>>on Linux with gcc 2.95.3 and OpenMotif 2.1.30 and with gcc 4.1.2 and
>>OpenMotif 2.3.0. I have not as yet fixed all the other Makefiles.
> 
> 
> Don't much like these, I must say. Can't we just wrap the variable name in
> a function-style macro as follows:
>   gcc ... '-D_U_(var)='
> then have function arglists such as
>   int aFunc(XtPointer _U_(unused1), UserArg _U_(unused2));
> and for compilers that don't like unnnamed args, use '-D_U_(var)=var'
> instead?

This is a direct steal from the way Wireshark does it. Their default
compile options these days include -Werror so as to minimize the chances
of doing something stupid.

Rather than '-D_U_(var)=' I'd prefer

'-D_U_(var)=var __attribute__((unused))'

which would be easier to make work with any compiler and possibly
simplify debugging by not having unnamed args.

Andrew
-- 
There's no point in being grown up if you can't be childish sometimes.
                -- Dr. Who
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to