Question: I m trying to build json-c with the following configuration:

```
./configure --target=arm-linux-androideabi --host=arm-linux-androideabi \
            --build=x86_64-unknown-linux-gnu

```

but I got the following error:

```
cc1: error: command line option '-std=c++11' is valid for C++/ObjC++ but not for C [-Werror]

```

I tried to add `--disable-std-c++11` and `--disable-std-cpp11` to the configure but I got always the same problem.

How to fix that?

Answer: 
Since there is no one answered me, I will answer to myself

In fact the `-std=c++11` is injected by the global variable `CPPFLAGS`.

I just added the following line before the `./configure` and the `-std=c++11` disappear

```
export CPPFLAGS=""

```
If the flag was set using `ADD_DEFINITIONS(-std=c++0x)`, it can be removed using `REMOVE_DEFINITIONS(-std=c++0x)`, then set for c++ only using `SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")`

Why would one do such a thing? In large, mixed "mostly-C++" projects, `ADD_DEFINITIONS` and `REMOVE_DEFINITIONS` is a quick way to switch between `std c++` levels based on a particular cmake directory but has the unintended side effect of throwing warnings during compilation -- or worse compilation failures on `-Werror` builds.