Fix warnings and errors building libiberty with pcc on vax-dec-ultrix4.3

Neil Booth neil@daikokuya.co.uk
Fri Sep 20 10:14:00 GMT 2002


Zack Weinberg wrote:-

> The warning is there because K+R preprocessors are reported to cause
> compile-time errors when function-like macros are used without
> arguments.  If PCC and the HPUX traditional compiler are fine with it,
> perhaps we don't need that warning after all.  I wish I'd kept around
> the copy of the original Reiser cpp that I got sent awhile ago.
> 
> However, it looks like md5.c could be changed to avoid this warning at
> the expense of some readability.
> 
> Neil, thoughts?

A trad CPP I have access to fails on

#define f(x) x
f 2

but works on 

#define f(x) x
#define g(x) x / 2
f(g)(1)

giving 1 / 2 (since there is no pre-expansion of arguments
traditionally, all is OK.  The warning comes in the ISO preprocessor
from pre-expansion).  It might be possible to avoid warning in the
latter case, but we would then not warn for

f(g) 1

when we should.

Neil.



More information about the Gcc-patches mailing list