[FFmpeg-devel] compound literal in public header file

Zhao Zhili quinkblack at foxmail.com
Wed May 16 05:18:33 EEST 2018


The av_err2str macro in libavutil/error.h use compound literal:

#define av_err2str(errnum) \
     av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, 
AV_ERROR_MAX_STRING_SIZE, errnum)

C++ compiler may not support it or treat the usage as invalid.
For example, g++ 5.4 raise an error: taking address of temporary
array.

1. Should the macro be defined for C only?
2. Or make it as valid C++? (I don't know how to do that)







More information about the ffmpeg-devel mailing list