Namespace alert!



Hi!

I'm unable to compile rather large parts of Gnome currently, due to
an error like this:

   gcc -DHAVE_CONFIG_H
   -I. -I. -I.. -DGNOMELOCALEDIR=\""/opt/gnome/share/locale"\"
   -I../intl -I../intl -I/opt/gnome/include -I/opt/gnome/include
   -DNEED_GNOMESUPPORT_H -I/opt/gnome/lib/gnome-libs/include
   -I/usr/X11R6/include -I/opt/gnome/lib/glib/include
   -I/usr/X11R6/include -I/opt/gnome/lib/glib/include
   -I/opt/gnome/include -mpentium -O2 -Wall -W -Wno-unused
   -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -c
   property-background.c
   /usr/include/__math.h: In function `tan':
   In file included from /usr/include/math.h:208,
                    from /opt/gnome/include/Imlib_types.h:10,
                    from /opt/gnome/include/Imlib.h:4,
                    from imlib-misc.h:4,
                    from property-background.c:19:
   /usr/include/__math.h:127: parse error before `__attribute__'
   /usr/include/__math.h:130: `__value2' undeclared (first use in this
   function)
   /usr/include/__math.h:130: (Each undeclared identifier is reported
   only once
   /usr/include/__math.h:130: for each function it appears in.)


The troublesome lines in __math.h is:


  register double __value;
  register double __value2 __attribute__ ((__unused__));
  __asm __volatile__
    ("fptan"
     : "=t" (__value2), "=u" (__value) : "0" (__x));


However, the real problem is within <libgnome/gnome-unused.h>, which
invades the namespace of gcc/egcs rather badly:

   #ifndef __unused__
   #ifdef __GNUC__
   #define __unused__	__attribute__ ((unused))
   #else
   #define __unused__
   #endif
   #endif


The resulting mess of the #define above is this:

  register double __value2 __attribute__ ((__attribute__ ((unused)) ));

I'm not surprised that the compiler doesn't grok that. 

-- 
/Wegge



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]