[PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
Kaveh R. GHAZI
ghazi@caip.rutgers.edu
Fri Aug 17 18:47:00 GMT 2007
On Fri, 17 Aug 2007, Joseph S. Myers wrote:
> On Fri, 17 Aug 2007, Andrew Pinski wrote:
>
> > On 8/17/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
> > > bootstrapping ada. When bootstrapping mainline, it complains about this
> > > in stage1:
> > >
> > > loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
> > > make[2]: *** [loop-invariant.o] Error 1
> >
> > Just a quick note. This is only undefined behavior at compile time.
> > http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_003.html#Question3
>
> Empty macro arguments were undefined in C90, but are allowed in C99; the
> DR relevant in C99 context is
> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_259.htm>.
>
> I don't know if we need to avoid empty arguments altogether in GCC or
> whether there is a safe subset of them (implemented in practice by C90
> compilers) we can use.
I don't know how you would distinguish "safe subset". Here gcc-2.8.1 is
crashing on the most simple incarnation of empty args. In another post, I
mentioned a more complicated case where solaris cc has a bug with empty
macro args and complex layers of macros with token concatenation.
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01131.html
Presumably we want to support bootstrap with older gcc versions. So IMHO
we should warn about *all* empty macro arguments, at least in C90 mode
(perhaps only with -pedantic on.)
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc-patches
mailing list