[PATCH] powerpc/boot: Remove duplicate typedefs from libfdt_env.h

Mark Greer mgreer at animalcreek.com
Fri Mar 30 13:26:52 AEDT 2018


On Thu, Mar 29, 2018 at 07:22:50PM -0700, Mark Greer wrote:
> On Tue, Mar 20, 2018 at 10:55:07AM +1100, Oliver wrote:

> > Yeah that's pretty odd. It might be a bug in your specific version of
> > GCC since I can't replicate it with this dumb test case:
> > 
> > #include <stdio.h>
> > typedef unsigned int            u32;
> > 
> > typedef u32 uint32_t;
> > typedef u32 uint32_t;
> > 
> > int main(void) {
> >         uint32_t test = 0;
> >         printf("%u\n", test);
> >         return 0;
> > }
> > 
> > Does that result in an error?
> 
> Hi Oliver.  I'm very sorry for the long delay in responding.
> 
> This fail to compile too:
> 
> $ cat test.c
> #include <stdio.h>
> typedef unsigned int u32;
> 
> typedef u32 uint32_t;
> typedef u32 uint32_t;
> 
> int main(void) {
> 	uint32_t test = 0;
> 	printf("%u\n", test);
> 	return 0;
> }
> $
> $ powerpc-linux-gnu-gcc -o test test.c
> test.c:5:13: error: redefinition of typedef 'uint32_t'
> test.c:4:13: note: previous declaration of 'uint32_t' was here

And I meant to add:

$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Sourcery G++ Lite 2010.09-55) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, yeah, its really old.

I'll get a newer one and test it.

Mark
--


More information about the Linuxppc-dev mailing list