sizeof size_t != sizeof unsigned long

Richard Smith kde at metafoo.co.uk
Sun Feb 22 17:45:56 GMT 2004


On Sunday 22 February 2004 5:07 pm, Nicolas Goutte wrote:
> 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.
>
> 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.

Perhaps this is a stupid suggestion, but can we do something like first 
calling the compiler with --this-option-does-not-exist, and if that succeeds, 
adding it in all subsequent calls to the compiler? That way compilers without 
this problem are unaffected, and those which allow just a single bad option 
break when presented with another option they don't understand.

Just a thought
Richard




More information about the kde-core-devel mailing list