sizeof size_t != sizeof unsigned long

Nicolas Goutte nicolasg at snafu.de
Sun Feb 22 17:07:16 GMT 2004


The check "sizeof size_t == sizeof unsigned long" fails (since at least Summer 
2003) for RH 7.3 systems and now it seems that it breaks for gcc 2.95 systems 
too.

(For a list of emails, see my email: 
http:/lists.kde.org/?l=kde-devel&m=107160002730997&w=2 .
The newest case on Debian with gcc 2.95:
http://lists.kde.org/?l=kde-devel&m=107739830103083&w=2 )

The problem seems that the compiler does not fail if it does not know *one* 
parameter but does fail if it does not know *two* parameters. This lead to 
silly results of the checks for the sizes of standard variable sizes. They 
return 0, which then makes fail the "sizeof size_t == sizeof unsigned long" 
check.

This can be seen in the config.log of this email:
http://lists.kde.org/?l=kde-devel&m=107605547903148&w=2
(Thread: http://lists.kde.org/?t=107599133600004&r=1&w=2 )

As for a solution, I do not know. Perhaps the easiest would be to check the 
GCC version and set a few variables typical for gcc 2.95/2.96. However I do 
not know if it is easy to add to the current checks.

Have a nice day!






More information about the kde-core-devel mailing list