[FFmpeg-devel] [PATCH] atoll() replacement for WinCE
Måns Rullgård
mans
Wed Jul 15 16:38:17 CEST 2009
Martin Storsj? <martin at martin.st> writes:
> On Wed, 15 Jul 2009, M?ns Rullg?rd wrote:
>
>> Martin Storsj? <martin at martin.st> writes:
>>
>> > Hmm, check_func_headers doesn't seem to work properly on the compilers
>> > I've got; I can reproduce this both on gcc 4.3 on linux and gcc 4.0 on OS
>> > X, and additionally with the mingw32ce compiler (gcc 4.1).
>> >
>> > To reproduce the case, try compiling this snippet:
>> >
>> > void functionThatDoesNotExist();
>> > int main(int argc, char **argv){
>> > (void) functionThatDoesNotExist;
>> > return 0;
>> > }
>> >
>> > Since the value of the function pointer isn't used, gcc seems to optimize
>> > away the whole reference to the function, so this compiles and links just
>> > fine.
>>
>> What if you change it to "return (int)functionThatDoesNotExist;" ?
>
> Then the check seems to work just as expected.
>
> That kind of check produces a warning on 64-bit architectures, though:
> warning: cast from pointer to integer of different size
New idea:
return !functionThatDoesNotExist;
Should be warning-free.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list