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

Compiler warnings in ConTagModel #2

Open
felixsh opened this issue Dec 10, 2017 · 0 comments
Open

Compiler warnings in ConTagModel #2

felixsh opened this issue Dec 10, 2017 · 0 comments

Comments

@felixsh
Copy link

felixsh commented Dec 10, 2017

Building ConTagModel from the contag-problem produces compiler warnings. The partial output being:

src/problems/conttag/ContTagModel.hpp:288:22: warning: the compiler can assume that the
address of ‘baseAction’ will never be NULL [-Waddress]
  assert(&baseAction != nullptr);
         ~~~~~~~~~~~~^~~~

The warning comes from this line: assert(&baseAction != nullptr);. It is part of some function which takes baseAction as argument by reference. As far as I know references in C++ can never point to NULL. So the assert line can safely be omitted, which fixes the compiler warnings as well.

Some discussion about it:

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

No branches or pull requests

1 participant