problem with string.h ???
Posted: Sun Jun 12, 2005 10:43 am
Yesterday I compiled the latest ps2sdk, and discovered that with this some stuff now fails to compile that did so error-free before. One example is LaunchELF, which gave the following result at 'make all' from a clean state:
Of that mess only 3 lines are significant, so I'll repeat these here for clarity:
Now, it is true that a 'memset2' function is declared at line 25 in itomisc.h, but that should not cause any conflict, since it is NOT true that either 'memset2' or the '\x0' sequence mentioned even exist in line 88 of string.h, which contains nothing of that kind. Instead, and unlike older versions of this file that I've seen, the current string.h has the following at line 88.
This should not cause any conflict with itomisc.h, as the name used is 'memset', not 'memset2' like the error message claims, and even that is a reference, not a declaration. So it seems to me as if the __inline__ implementation is somehow bugged, or possibly being bugged by some bad macro. I haven't found the real cause myself, but it could have something to do with other headers that were read before string.h, so here is a list of those, in referenced order:
ito.h (#includes all ito headers except itoglobal.h), stdio.h, tamtypes.h, sifcmd.h, kernel.h, sifrpc.h, loadfile.h, followed by string.h which gave the error.
As you can see, apart from the ito stuff (of libito 0.2.1), only ps2sdk files are involved, so the problem doesn't seem specific to the LaunchELF project. It could strike anyone using the same headers...
I hope someone else can solve this, because I can't get any grip on this myself.
NB: though I discovered this yesterday, the problem may have existed much longer, as I've been using ps2sdk 1.2 until yesterday.
Best regards: dlanor
Code: Select all
ee-gcc -D_EE -O2 -G0 -Wall -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/p
s2dev/ps2sdk/common/include -I. -I/usr/local/ps2dev/libito/include -I/usr/local/
ps2dev/sbv-1.0-lite/include -I/usr/local/ps2dev/libcdvd/ee -c main.c -o main.o
In file included from launchelf.h:11,
from main.c:1:
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: parse error before '\x0'
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: conflicting types for `memset2'
/usr/local/ps2dev/libito/include/itomisc.h:25: previous declaration of `memset2'
/usr/local/ps2dev/ps2sdk/ee/include/string.h: In function `memset2':
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: `p' undeclared (first use in th
is function)
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: (Each undeclared identifier is
reported only once
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: for each function it appears in
.)
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: `n' undeclared (first use in th
is function)
make: *** [main.o] Error 1
Code: Select all
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: parse error before '\x0'
/usr/local/ps2dev/ps2sdk/ee/include/string.h:88: conflicting types for `memset2'
/usr/local/ps2dev/libito/include/itomisc.h:25: previous declaration of `memset2'
Code: Select all
static __inline__ void bzero(void * p, size_t n) { memset(p, 0, n); }
ito.h (#includes all ito headers except itoglobal.h), stdio.h, tamtypes.h, sifcmd.h, kernel.h, sifrpc.h, loadfile.h, followed by string.h which gave the error.
As you can see, apart from the ito stuff (of libito 0.2.1), only ps2sdk files are involved, so the problem doesn't seem specific to the LaunchELF project. It could strike anyone using the same headers...
I hope someone else can solve this, because I can't get any grip on this myself.
NB: though I discovered this yesterday, the problem may have existed much longer, as I've been using ps2sdk 1.2 until yesterday.
Best regards: dlanor