Skip to content
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

compile with -Wall -Wextra with no warnings #19

Closed
ghorn opened this issue Apr 4, 2013 · 7 comments
Closed

compile with -Wall -Wextra with no warnings #19

ghorn opened this issue Apr 4, 2013 · 7 comments
Assignees
Milestone

Comments

@ghorn
Copy link
Contributor

ghorn commented Apr 4, 2013

I don't think this will cause exceptional hardship in most cases

@mvukov
Copy link
Member

mvukov commented Apr 4, 2013

This is already in the compiler flags, look at cmake/CompilerOptions.cmake. OK, will add -Wextra :)

@mvukov mvukov closed this as completed Apr 4, 2013
@mvukov mvukov reopened this Apr 4, 2013
@ghost ghost assigned mvukov Apr 4, 2013
@ghorn
Copy link
Contributor Author

ghorn commented Apr 8, 2013

Right now I'm seeing these warnings:

acado/src/utils/acado_string.cpp: In constructor ‘ACADO::String::String(const double&)’:
acado/src/utils/acado_string.cpp:69:15: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]

acado/src/matrix_vector/matrix.cpp: In member function ‘ACADO::Vector ACADO::Matrix::getEigenvalues(ACADO::Matrix&) const’:
acado/src/matrix_vector/matrix.cpp:672:22: warning: variable ‘cos_2phi’ set but not used [-Wunused-but-set-variable]

acado/src/user_interaction/plot_window.cpp: In member function ‘ACADO::returnValue ACADO::PlotWindow::setupLogFrequency(ACADO::PlotFrequency)’:
acado/src/user_interaction/plot_window.cpp:734:15: warning: variable ‘logFrequency’ set but not used [-Wunused-but-set-variable]

acado/src/sparse_solver/normal_conjugate_gradient_method.cpp: In member function ‘virtual ACADO::returnValue ACADO::NormalConjugateGradientMethod::setIndices(const int*)’:
acado/src/sparse_solver/normal_conjugate_gradient_method.cpp:141:9: warning: variable ‘bound2’ set but not used [-Wunused-but-set-variable]

acado/src/code_generation/model_data.cpp: In member function ‘std::vector<ACADO::Matrix> ACADO::ModelData::getOutputDependencies() const’:
acado/src/code_generation/model_data.cpp:178:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
acado/src/code_generation/model_data.cpp:184:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
acado/src/code_generation/model_data.cpp: In member function ‘ACADO::Vector ACADO::ModelData::getDimOutputs() const’:
acado/src/code_generation/model_data.cpp:490:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
acado/src/code_generation/model_data.cpp: In member function ‘ACADO::Vector ACADO::ModelData::getNumMeas() const’:
acado/src/code_generation/model_data.cpp:513:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

acado/src/code_generation/condensing_export.cpp: In member function ‘ACADO::returnValue ACADO::CondensingExport::setupMultiplicationRoutines()’:
acado/src/code_generation/condensing_export.cpp:549:20: warning: declaration of ‘Gx’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:550:20: warning: declaration of ‘Gu’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:555:20: warning: declaration of ‘C’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:556:20: warning: declaration of ‘QC’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:557:20: warning: declaration of ‘E’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:558:20: warning: declaration of ‘QE’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:559:20: warning: declaration of ‘QDx’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:560:20: warning: declaration of ‘g0’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:561:20: warning: declaration of ‘g1’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:562:20: warning: declaration of ‘H00’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:563:20: warning: declaration of ‘H01’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/condensing_export.cpp:564:20: warning: declaration of ‘H11’ shadows a member of 'this' [-Wshadow]


acado/src/code_generation/sim_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::SIMexport::exportCode(const ACADO::String&, const ACADO::String&, const ACADO::String&, int)’:
acado/src/code_generation/sim_export.cpp:161:6: warning: declaration of ‘exportTest’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/sim_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::SIMexport::exportAndRun(const ACADO::String&, const ACADO::String&, const ACADO::String&, const ACADO::String&, const ACADO::String&)’:
acado/src/code_generation/sim_export.cpp:743:6: warning: variable ‘nil’ set but not used [-Wunused-but-set-variable]
acado/src/code_generation/sim_export.cpp: In member function ‘ACADO::returnValue ACADO::SIMexport::executeTest(const ACADO::String&)’:
acado/src/code_generation/sim_export.cpp:1022:6: warning: variable ‘nil’ set but not used [-Wunused-but-set-variable]


acado/src/code_generation/integrators/erk_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::ExplicitRungeKuttaExport::setLinearOutput(const ACADO::Matrix&, const ACADO::Matrix&, const ACADO::Expression&)’:
acado/src/code_generation/integrators/erk_export.cpp:256:114: warning: declaration of ‘rhs’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/integrators/erk_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::ExplicitRungeKuttaExport::setupOutput(std::vector<ACADO::Grid>, std::vector<ACADO::Expression>)’:
acado/src/code_generation/integrators/erk_export.cpp:341:124: warning: declaration of ‘rhs’ shadows a member of 'this' [-Wshadow]


acado/src/code_generation/integrators/narx_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::NARXExport::setLinearOutput(const ACADO::Matrix&, const ACADO::Matrix&, const ACADO::Expression&)’:
acado/src/code_generation/integrators/narx_export.cpp:268:100: warning: declaration of ‘rhs’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/integrators/narx_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::NARXExport::setupOutput(std::vector<ACADO::Grid>, std::vector<ACADO::Expression>)’:
acado/src/code_generation/integrators/narx_export.cpp:343:110: warning: declaration of ‘rhs’ shadows a member of 'this' [-Wshadow]


acado/src/code_generation/integrators/irk_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::ImplicitRungeKuttaExport::setLinearOutput(const ACADO::Matrix&, const ACADO::Matrix&, const ACADO::Expression&)’:
acado/src/code_generation/integrators/irk_export.cpp:150:114: warning: declaration of ‘rhs’ shadows a member of 'this' [-Wshadow]
acado/src/code_generation/integrators/irk_export.cpp:178:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
acado/src/code_generation/integrators/irk_export.cpp: In member function ‘ACADO::returnValue ACADO::ImplicitRungeKuttaExport::generateOutput(ACADO::ExportStatementBlock*, const ACADO::ExportIndex&, const ACADO::ExportIndex&, const ACADO::ExportIndex&, const ACADO::ExportIndex&, const ACADO::ExportVariable&, const ACADO::ExportVariable&, const ACADO::ExportVariable&)’:
acado/src/code_generation/integrators/irk_export.cpp:1671:37: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses]

acado/src/code_generation/linear_solvers/householder_qr_export.cpp: In member function ‘virtual ACADO::returnValue ACADO::ExportHouseholderQR::setup()’:
acado/src/code_generation/linear_solvers/householder_qr_export.cpp:276:15: warning: variable ‘structWspace’ set but not used [-Wunused-but-set-variable]

@ghorn
Copy link
Contributor Author

ghorn commented Apr 8, 2013

there are more in qp oases, csparse, and gnuplot, but i think we can ignore those

@ghorn
Copy link
Contributor Author

ghorn commented Apr 10, 2013

@rienq could you look at the ones in integrators and sim_export please?

@mvukov
Copy link
Member

mvukov commented Aug 2, 2013

We achieved "clean" compilation with -Wall flags. -Wextra is still producing a lot of warnings, and btw this flag is not used.

You can monitor builds here: https://travis-ci.org/acado/acado

@rienq
Copy link
Member

rienq commented Aug 2, 2013

awesome ! :-)

@mvukov
Copy link
Member

mvukov commented Aug 12, 2013

OK, this seems to be finalized....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants