[libav-bugs] [Bug 844] New: libav does not build with clang 3.5 and warnings-as-errors (-Werror)

bugzilla at aruru.libav.org bugzilla at aruru.libav.org
Tue Apr 14 00:24:40 CEST 2015


https://bugzilla.libav.org/show_bug.cgi?id=844

            Bug ID: 844
           Summary: libav does not build with clang 3.5 and
                    warnings-as-errors (-Werror)
           Product: Libav
           Version: 0.8
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: ---
         Component: general
          Assignee: bugzilla at libav.org
          Reporter: dkeeler at mozilla.com

STR:

With clang 3.5, run `./configure --cc=clang --extra-cflags=-Werror` and then
`make`.

Results:

CC      libavdevice/alldevices.o
In file included from libavdevice/alldevices.c:22:
In file included from ./libavformat/avformat.h:140:
In file included from ./libavcodec/avcodec.h:30:
In file included from ./libavutil/samplefmt.h:22:
In file included from ./libavutil/avutil.h:319:
In file included from ./libavutil/common.h:347:
./libavutil/mem.h:79:73: error: unknown attribute 'alloc_size' ignored
[-Werror,-Wunknown-attributes]
void *av_malloc(size_t size) __attribute__((__malloc__))
__attribute__((alloc_size(1)));
                                                                        ^
./libavutil/mem.h:93:57: error: unknown attribute 'alloc_size' ignored
[-Werror,-Wunknown-attributes]
void *av_realloc(void *ptr, size_t size) __attribute__((alloc_size(2)));
                                                        ^
./libavutil/mem.h:113:74: error: unknown attribute 'alloc_size' ignored
[-Werror,-Wunknown-attributes]
void *av_mallocz(size_t size) __attribute__((__malloc__))
__attribute__((alloc_size(1)));
                                                                         ^
etc.

It appears that clang 3.5 defines __GNUC__ as 4 and __GNUC_MINOR__ as 3,
meaning that AV_GCC_VERSION_AT_LEAST(4,3) is satisfied. In libavutil/mem.h, we
have this:

#if AV_GCC_VERSION_AT_LEAST(4,3)
    #define av_alloc_size(n) __attribute__((alloc_size(n)))
#else
    #define av_alloc_size(n)
#endif

However, while clang used to have some support for alloc_size, it has
apparently removed it: https://github.com/neovim/neovim/issues/429

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-bugs/attachments/20150413/a02767e5/attachment-0001.html>


More information about the libav-bugs mailing list