-
Notifications
You must be signed in to change notification settings - Fork 2.7k
cmake throws warning treated as error message when executed inside TravisCI #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Check: You can remove flag - -Werror=conversion |
@ya1gaurav, let's change the default. I don't think we can fix |
PR for - open-source-parsers#586 Separating the default options for compiler flags.
please do this. seeing this error too. Am able to compile fine without -W error on conversion flag |
I'm trying to use jsoncpp as part of my project. The end goal is to get the following files:
So, I have a .travis.yml file inside my repo (which will always run whenever I push to github) that looks like this:
---
language: java
sudo: true
jdk: oraclejdk8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- george-edison55-precise-backports # cmake 3.2.3 / doxygen 1.8.3
packages:
- cmake
- cmake-data
- gcc-4.9
- g++-4.9
- clang-3.5
- valgrind
before_install:
- sudo apt-get -qq update
- git clone https://github.com/open-source-parsers/jsoncpp.git
- cd jsoncpp
- python amalgamate.py
- mkdir build
- cd build
- cmake ..
- make
script:
- cp src/lib_json/libjsoncpp.a /usr/local/lib/
The yaml runs perfectly up until the make statement (so I'm able to retrieve the first three files I need), but then it logs the following message:
$ make
Scanning dependencies of target jsoncpp_lib_static
[ 16%] Building CXX object src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_reader.cpp.o
[ 33%] Building CXX object src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_value.cpp.o
/home/travis/build/fire-d/testDemo/jsoncpp/src/lib_json/json_value.cpp: In copy constructor Json::Value::CZString::CZString(const Json::Value::CZString&)’:
/home/travis/build/fire-d/testDemo/jsoncpp/src/lib_json/json_value.cpp:273:78: error: conversion to unsigned char:2’ from ‘unsigned int’ may alter its value [-Werror=conversion]
cc1plus: some warnings being treated as errors
make[2]: *** [src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_value.cpp.o] Error 1
make[1]: *** [src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/all] Error 2
make: *** [all] Error 2
The command "make" failed and exited with 2 during .
Apparently, the build fails because these two warnings are treated as errors. I have also noticed that versions 4.9 of gcc and gpp are installed correctly, but I don't know if the compiler used is the one I am telling it to use.
Is there any way I can make the "warnings being treated as errors" message go away? Anyone had a similar problem with a similar build? Should I try a different approach to get src/lib_json/libjsoncpp.a? Thank you.
PD: Link to full log here.
The text was updated successfully, but these errors were encountered: