Opened 3 years ago
Closed 2 years ago
#9503 closed enhancement (wontfix)
Make avutil header files -Wconversion safe
Reported by: | mstoeckl | Owned by: | |
---|---|---|---|
Priority: | wish | Component: | avutil |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description (last modified by )
The header files for libavutil define a number of inline functions, like av_clip_uintp2_c
and av_ceil_log2_c
in common.h
. When code using libavutil includes these headers, and the headers are stored in some path the compiler doesn't recognize as containing "system" headers, compiling the code with the -Wconversion
flag will produce warnings for them.
It would be nice if these inline functions would make all value-changing conversions explicit, using appropriate casts, and thus stop producing -Wconversion warnings.
I've set this to wishlist priority, because most of the time, FFmpeg headers are installed under /usr/include and are automatically treated as system headers by the compiler; so this is only an annoyance when installing FFmpeg to nonstandard paths. Furthermore, one can (in theory) configure one's build system to pass the right flags/env variables to the compiler so that the -Wconversion errors from the libavutil headers are silenced. (Unfortunately, I haven't figured this out yet for one build system that I am using, nor for a code analysis tool.)
Note: while -Wconversion is a reasonable flag to apply for some of the small projects I have, this issue is not a request to make FFmpeg's entire code base avoid the warning.
Change History (2)
comment:1 by , 3 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is very unlikely to happen. If you believe that I am too hasty please send a patch for discussion to the development mailing list.