[FFmpeg-devel] [PATCH] atoll() replacement for WinCE

Martin Storsjö martin
Wed Jul 15 16:23:38 CEST 2009


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

But as long as that is just treated as a warning and not an error, the 
check works fine. A way of fixing it would be to cast it through an 
intptr_t, but that'd require inclusion of stdint.h.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-check_func_headers.patch
Type: text/x-diff
Size: 426 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090715/f3542d4b/attachment.patch>



More information about the ffmpeg-devel mailing list