This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ppc more sensitive to duplicate typedefs?


Hello,
    I was wondering if the following observation made any
sense. In working over the last few years on ppclinux, using
gcc 2.95.x I have noticed that many of the code changes I
often had to correct included a lot of duplicate typedefs 
which caused compiler errors. Is it possible that one arch
is more sensitive to this than another in gcc? I ask because
I just fixed a problem with the latest xfree86 build on debian
sid where on the ppc we were getting an error...

xf86drmSiS.c:69: conflicting types for `drm_sis_mem_t'
kernel/sis_drm.h:10: previous declaration of `drm_sis_mem_t'
xf86drmSiS.c:73: conflicting types for `drm_sis_agp_t'
kernel/sis_drm.h:14: previous declaration of `drm_sis_agp_t'
xf86drmSiS.c:77: conflicting types for `drm_sis_flip_t'
kernel/sis_drm.h:18: previous declaration of `drm_sis_flip_t'
make[9]: *** [xf86drmSiS.o] Error 1

where both xf86drmSiS.c and kernel/sis_drm.h had the same 
declarations...

typedef struct {
  int context;
  unsigned int offset;
  unsigned int size;
  unsigned int free;
} drm_sis_mem_t;

typedef struct {
  unsigned int offset, size;
} drm_sis_agp_t;

typedef struct {
  unsigned int left, right;
} drm_sis_flip_t;

I solved this by moving the #ifdef __KERNEL__ kernel wrapper in
kernel/sis_drm.h up to enclose those lines in that file. What
puzzles me is the same parsing of those files should have happened 
on i386, hppa and alpha yet they all compiled fine without this 
change. Is it possible that gcc 2.95.4 is more 'forgiving' to
duplicate typedefs on those arches? If that is true, shouldn't 
all the arches be 'tightened up' to be as strict as ppc on this?
Otherwise ppc will always be catching these errors for everyone
else. Thanks in advance for any comments.
                    Jack Howarth


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]