Build system should specify -std=gnu++98 by default

Issue #199 resolved
James Almer created an issue

Starting with GCC 6 the default C++ standard was switched to C++14. This results in compilation errors with some files. For example:

/home/jamrial/x265/source/common/param.cpp:1397:47: error: unable to find string literal operator ‘operator""cliopt’ with ‘const char [4]’, ‘long unsigned int’ arguments s += sprintf(s, " %s", (param) ? cliopt : "no-"cliopt);

Because of the new User-defined literals feature in C++11, or warnings like

/home/jamrial/x265/source/common/ipfilter.cpp: In instantiation of ‘void {anonymous}::interp_vert_ps_c(const pixel, intptr_t, int16_t, intptr_t, int) [with int N = 4; int width = 8; int height = 64; pixel = unsigned char; intptr_t = long int; int16_t = short int]’: /home/jamrial/x265/source/common/ipfilter.cpp:491:5: required from here /home/jamrial/x265/source/common/ipfilter.cpp:212:36: warning: left shift of negative value [-Wshift-negative-value] int offset = -IF_INTERNAL_OFFS << shift;

That do not happen if one specifies -DCMAKE_CXX_FLAGS="-std=gnu++98" when configuring x265. So please, add it to the default command line options.

Comments (3)

  1. Log in to comment