[FFmpeg-devel] [PATCH 1/8] Don't use the alloc_size attribute with ICC.

Måns Rullgård mans
Thu Oct 2 16:48:27 CEST 2008


Diego 'Flameeyes' Petten? wrote:
> The Intel C Compiler does not support the alloc_size attribute that
> GCC 4.2+ supports, although it declares itself as GCC 4.3.0, disable
> the attribute if __ICC is also defined.
> ---
>
>  libavutil/mem.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavutil/mem.h b/libavutil/mem.h
> index a02c7e1..272219c 100644
> --- a/libavutil/mem.h
> +++ b/libavutil/mem.h
> @@ -48,7 +48,7 @@
>      #define av_malloc_attrib
>  #endif
>
> -#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2)
> +#if defined(__GNUC__) && !defined(__ICC) && (__GNUC__ > 4 || __GNUC__ == 4
&& __GNUC_MINOR__ > 2)
>      #define av_alloc_size(n) __attribute__((alloc_size(n)))
>  #else
>      #define av_alloc_size(n)

I would prefer the __ICC test at the end of the line, keeping all the gcc
stuff together.  I'd also break the line in two.

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




More information about the ffmpeg-devel mailing list