Opened 2 years ago

Closed 19 months 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 mstoeckl)

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 mstoeckl, 2 years ago

Description: modified (diff)

comment:2 by Carl Eugen Hoyos, 19 months ago

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.