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

Måns Rullgård mans
Wed Jul 15 18:46:14 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:
>> 
>> > On Wed, 15 Jul 2009, M?ns Rullg?rd wrote:
>> >
>> >> > 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.
>> >
>> > No, unfortunately not:
>> > test.c:3: warning: the address of 'functionThatDoesntExist', will always 
>> > evaluate as 'true'
>> >
>> > And the compiler optimizes the whole access away...
>> 
>> Oh damn.  Use (long) then.  That should be warning-free on most
>> machines.
>
> Great! This seems to work just fine. Patch attached.
>
> // Martin
>
> ---
>  configure |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index a700220..082b918 100755
> --- a/configure
> +++ b/configure
> @@ -646,8 +646,7 @@ check_func_headers(){
>      check_ld "$@" <<EOF && enable $func && enable_safe $headers
>  $incs
>  int main(int argc, char **argv){
> -    (void) $func;
> -    return 0;
> +    return (long) $func;
>  }
>  EOF
>  }

OK

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list