[FFmpeg-devel] Non-void function without return value
Dominique Leuenberger
dominique at leuenberger.net
Wed Nov 30 15:07:48 CET 2011
Hi everybody,
While building current git master of ffmpeg, brp (Build Root policy)
checker raises an error about a non-void function not returning a value.
I: Program returns random data in a function
E: ffmpeg no-return-in-nonvoid-function libavcodec/wmalosslessdec.c:322
The function in question is:
static int dump_int_buffer(int *buffer, int length, int delimiter)
{
int i;
for (i=0 ; i<length ; i++) {
if (!(i%delimiter))
av_log(0, 0, "\n[%d] ", i);
av_log(0, 0, "%d, ", buffer[i]);
}
av_log(0, 0, "\n");
}
So, yes, the bro check is right (and the compiler spits a warning).
Unfortunately, from this code snip, I'm not even sure if it needs to
return a value at all, likely not:
The usage of the function happens (in the same source file) in the
function
static int decode_channel_residues(WmallDecodeCtx *s, int ch, int
tile_size) and it is simply called as
static int decode_channel_residues(WmallDecodeCtx *s, int ch, int
tile_size
=> Thus, implying that void would be a perfect valid prototype for this
function. But maybe there are plans for the future.
Best regards,
Dominique
More information about the ffmpeg-devel
mailing list