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

Mark Greer mgreer at animalcreek.com
Sat Mar 31 13:42:29 AEDT 2018


On Thu, Mar 29, 2018 at 07:26:52PM -0700, Mark Greer wrote:
> 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.

I downloaded this version from denx.de (thank you, Wolfgang):

$ powerpc-linux-gcc --version
powerpc-linux-gcc (GCC) 4.8.2
Copyright (C) 2013 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.

Its still dated but its the best prebuilt version that I could find easily
available.  With this version, the kernel (ppc6xx_defconfig) built without
issue.

Thanks to all who helped me through this.

To Ben or whoever, I think the original patch is still worth applying even
if it isn't critical.

Thanks,

Mark
--


More information about the Linuxppc-dev mailing list