Skip to content

Commit

Permalink
build: specify c++-dialect
Browse files Browse the repository at this point in the history
in configure.py, we always use 'g++' for testing the supported C++
dialects, but we might want to use a different C++ compiler by passing
--compiler=${a_better_cxx}, so in that case, the default C++ dialect of
'gnu++1y' is used, it is a deprecated GNU extension based on C++14,
which is not the best C++ dialect we can heve from the specified
compiler. so, we should specifiy the c++-dialect in travis recipe
explicitly. as we know what dialect the installed compiler supports,
and more importantly, C++17 is needed for copy elision, as we requires
the compiler to not copy the return value if it is a "pure" rvalue.
for instance, in seastar/tests/fstream_test.cc, see the struct of
"fstream_wrapper", as its member variable of "input_stream" does not
have a copy constructor, this instructs the compiler to define
"input_stream"'s copy contructor as deleted. but "make_fstream()"
returns an instance of "fstream_wrapper" as its return value, without
copy elision and the copy constructor of "fstream_wrapper", this source
file will fail to compile. the same problem also pops up in some
other places in seastar's source tree. so we practically *require*
C++17 to compile seastar.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jul 16, 2018
1 parent d672ec7 commit e6fc294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ matrix:
- g++-7

before_script:
- ./configure.py --mode=release ${DPDK_MODE} --compiler=${COMPILER} --c-compiler=${C_COMPILER} --cflags="-I/opt/scylladb/include/ $CFLAGS" --ldflags="-L/opt/scylladb/lib/x86_64-linux-gnu/"
- ./configure.py --mode=release ${DPDK_MODE} --compiler=${COMPILER} --c-compiler=${C_COMPILER} --c++-dialect="gnu++17" --cflags="-I/opt/scylladb/include/ $CFLAGS" --ldflags="-L/opt/scylladb/lib/x86_64-linux-gnu/"

script:
- ninja -j`nproc --all`

0 comments on commit e6fc294

Please sign in to comment.