I'm a little confused by the current usage of getsectdatafromheader_64 in
unwind-dw2-fde-darwin.c on Darwin PPC. I see a build warning of...

/sw/src/fink.build/gcc4-4.1.9999-20060928/darwin_objdir/./gcc/xgcc 
-B/sw/src/fink.build/gcc4-4.1.9999-20060928/darwin_objdir/./gcc/ 
-B/sw/lib/gcc4/powerpc-apple-
darwin8/bin/ -B/sw/lib/gcc4/powerpc-apple-darwin8/lib/ -isystem 
/sw/lib/gcc4/powerpc-apple-darwin8/include -isystem 
/sw/lib/gcc4/powerpc-apple-darwin8/sys-includ
e -O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  
-Wa,-force_cpusubtyp
e_ALL -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. 
-I. -I../../gcc-4.2-20060928/gcc -I../../gcc-4.2-20060928/gcc/. 
-I../../gcc-4.2-200
60928/gcc/../include -I./../intl -I../../gcc-4.2-20060928/gcc/../libcpp/include 
-I/sw/include  -I../../gcc-4.2-20060928/gcc/../libdecnumber -I../libdecnumber 
-m6
4 -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c 
../../gcc-4.2-20060928/gcc/unwind-dw2-fde-darwin.c -o 
libgcc/ppc64/unwind-dw2-fde-darwin.o
../../gcc-4.2-20060928/gcc/unwind-dw2-fde-darwin.c: In function 
'examine_objects':
../../gcc-4.2-20060928/gcc/unwind-dw2-fde-darwin.c:167: warning: passing 
argument 1 of 'getsectdatafromheader_64' from incompatible pointer type

which leads to the code...

        /* For ppc only check whether or not we have __DATA eh frames.  */
#ifdef __ppc__
        fde = getsectdatafromheader (image->mh, "__DATA", "__eh_frame", &sz);
#endif

        if (fde == NULL)
          {
#if __LP64__
            fde = getsectdatafromheader_64 ((struct mach_header_64 *) image->mh,
                                            "__TEXT", "__eh_frame", &sz);
#else
            fde = getsectdatafromheader (image->mh, "__TEXT",
                                         "__eh_frame", &sz);
#endif

My first question is why is the external declaration...

extern char *getsectdatafromheader_64 (struct mach_header*, const char*

...rather than...

extern char *getsectdatafromheader_64 (struct mach_header_64*, const char*

Also, why isn't the first getsectdatafromheader call wrappered with '#if 
__LP64__'
like the second?
                     Jack

Reply via email to