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

Bug#34690: glibc2.1 header bug



Package: libc6-dev
Version: 2.1.1-0pre1.3

Hi,

Yet another glibc2.1 problem/bug. :)

The macro "NGREG" (the number of general registers) is defined in both 
`/usr/include/sys/ucontext.h' and `/usr/include/sys/elf.h'.  Also, a
bunch of related "greg" typedefs are also defined in both headers.
Including both of these headers causes "previously defined here"
compile time errors.  For example, I #included <sys/ucontext.h> and
<sys/procfs.h> (which #includes <sys/elf.h>) in the same source file
and got several "previously defined" errors for the NGREG macro.

I tend to think that the NGREG in <sys/elf.h> is the more "correct"
#define since it actually uses sizeof on the general register
structure rather than some "magic" number, 19 in this case.  I'd
suggest placing "#ifndef NGREG" guards around each of #define NGREG
declarations.  Contacting the upstream authors is also in order.  I'm
not sure about the typedefs.

Error Output:
c++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -Wall -Wpointer-arith -fno-implicit-templates -I/usr/X11R6/include -g -O2 -pthread -pipe -O3 -I. -I. -I. -I. -Wp,-MD,.deps/ACE.pp -c  -fPIC -DPIC ACE.cpp -o ACE.lo
In file included from /usr/include/ucontext.h:27,
                 from ../ace/OS.h:3410,
                 from ../ace/ACE.h:18,
                 from ACE.cpp:4:
/usr/include/sys/ucontext.h:34: warning: `NGREG' redefined
/usr/include/sys/procfs.h:46: warning: this is the location of the previous definition
In file included from /usr/include/ucontext.h:27,
                 from ../ace/OS.h:3410,
                 from ../ace/ACE.h:18,
                 from ACE.cpp:4:
/usr/include/sys/ucontext.h:31: conflicting types for `typedef int greg_t'
/usr/include/sys/procfs.h:43: previous declaration as `typedef elf_greg_t greg_t'
/usr/include/sys/ucontext.h:37: conflicting types for `typedef int gregset_t[19]'
/usr/include/sys/procfs.h:44: previous declaration as `typedef long unsigned int gregset_t[17]'
/usr/include/sys/ucontext.h:83: conflicting types for `typedef struct _fpstate * fpregset_t'
/usr/include/sys/procfs.h:45: previous declaration as `typedef struct elf_fpregset_t fpregset_t'



Thanks,
-Ossama
______________________________________________________________________
Ossama Othman <othman@cs.wustl.edu>
58 60 1A E8 7A 66 F4 44  74 9F 3C D4 EF BF 35 88  1024/8A04D15D 1998/08/26


Reply to: