Closed ashemedai closed 11 years ago
YCM sets the -Wc++98-compat
warning flag. This is there so that I don't accidentally introduce a C++11 feature into what is supposed to be a C++03 codebase (which I still want to compile in C++11 mode because of move ctors etc).
Your system appears to be doing something incredibly unwise which is to #define NULL nullptr
. Your /usr/include/sys/_null.h
file probably detects that the compilation mode is C++11 and then sets that. It's still a bad idea though, NULL is not nullptr and effectively doing a global search/replace of NULL to nullptr will lead to issues like these.
Replacing -std=c++0x
with -std=c++03
in the compiler flags should get it to compile (you may also need to remove the -stdlib=libc++
flag). If it works, please inform me and I'll add a check to the cmake build scripts for FreeBSD.
[You could also just remove the -Wc++98-compat
flag]
Using the latest git version (as of 2013-04-21) when I try to build ycm_core I run into this build issue:
The CXXFLAGS turn out to be: CXX_FLAGS = -stdlib=libc++ -std=c++0x -Wall -Wextra -Werror -Wc++98-compat -Wno-long-long -Wno-variadic-macros -Wno-missing-field-initializers -Wno-unused-private-field -O3 -DNDEBUG -isystem
Using -std=c++0x sets clang++ 3.2 to define __cplusplus as 201103L, basically saying it's operating at C++11 level, which actually allows for nullptr, so erroring out on c++98 compatibility seems odd at best.
FreeBSD 9.1-STABLE (April 2013) with FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221 Target: x86_64-unknown-freebsd9.1 Thread model: posix