{"action":"created","issue":{"url":"https://api.github.com/repos/Cantera/cantera/issues/365","repository_url":"https://api.github.com/repos/Cantera/cantera","labels_url":"https://api.github.com/repos/Cantera/cantera/issues/365/labels{/name}","comments_url":"https://api.github.com/repos/Cantera/cantera/issues/365/comments","events_url":"https://api.github.com/repos/Cantera/cantera/issues/365/events","html_url":"https://github.com/Cantera/cantera/issues/365","id":176183804,"number":365,"title":"Many \"unused parameter\" warnings","user":{"login":"g3bk47","id":22117927,"avatar_url":"https://avatars.githubusercontent.com/u/22117927?v=3","gravatar_id":"","url":"https://api.github.com/users/g3bk47","html_url":"https://github.com/g3bk47","followers_url":"https://api.github.com/users/g3bk47/followers","following_url":"https://api.github.com/users/g3bk47/following{/other_user}","gists_url":"https://api.github.com/users/g3bk47/gists{/gist_id}","starred_url":"https://api.github.com/users/g3bk47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g3bk47/subscriptions","organizations_url":"https://api.github.com/users/g3bk47/orgs","repos_url":"https://api.github.com/users/g3bk47/repos","events_url":"https://api.github.com/users/g3bk47/events{/privacy}","received_events_url":"https://api.github.com/users/g3bk47/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-10T14:59:10Z","updated_at":"2016-09-11T00:35:03Z","closed_at":null,"body":"Code like [THIS](https://github.com/Cantera/cantera/blob/2b2f733bd9d7f3957bb0e3ab27c4bd07a1b03053/include/cantera/thermo/ThermoPhase.h#L477) generates many \"unused parameter\" warnings when I try to compile my own programs. This messes up any \"treat warnings as errors\" setup.  I understand that you want to refer to the function argument by name in the doxygen text, but maybe omitting the argument name for the sake of warning-free code is more important? Maybe a better solution is moving the definition out of the header into the source file? Alternatively you could comment the argument name like this\r\n`virtual void getChemPotentials_RT(doublereal* /*mu*/) const {`\r\nbut moving the definition into the source file seems more reasonable.\r\n\r\nThis also happens in a few other headers like `oneD/Domain1D.h`, `numerics/GeneralMatrix.h` or `thermo/SpeciesThermoInterpType.h` where `NotImplementedError` is used."},"comment":{"url":"https://api.github.com/repos/Cantera/cantera/issues/comments/246154264","html_url":"https://github.com/Cantera/cantera/issues/365#issuecomment-246154264","issue_url":"https://api.github.com/repos/Cantera/cantera/issues/365","id":246154264,"user":{"login":"speth","id":644977,"avatar_url":"https://avatars.githubusercontent.com/u/644977?v=3","gravatar_id":"","url":"https://api.github.com/users/speth","html_url":"https://github.com/speth","followers_url":"https://api.github.com/users/speth/followers","following_url":"https://api.github.com/users/speth/following{/other_user}","gists_url":"https://api.github.com/users/speth/gists{/gist_id}","starred_url":"https://api.github.com/users/speth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speth/subscriptions","organizations_url":"https://api.github.com/users/speth/orgs","repos_url":"https://api.github.com/users/speth/repos","events_url":"https://api.github.com/users/speth/events{/privacy}","received_events_url":"https://api.github.com/users/speth/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T00:35:03Z","updated_at":"2016-09-11T00:35:03Z","body":"What compiler and flags are you using? Cantera compiles (mostly) warning-free on GCC, Clang, and MSVC using the `-Wall` or `/W3` flags. I guess maybe you're compiling with `-Wextra`? I think this highlights the fact that the 'unused parameter' warnings are prone to being false positives in just about any code that uses virtual methods. I don't think I have any desire to make Cantera compile with no warnings at the level of `-Wextra`.\r\n\r\nI definitely don't like the idea of removing the parameter name in order to suppress the warning, even (or especially) in the absence of Doxygen documentation for the parameters.\r\n\r\nMoving the definition to the source file is a possibility, but just adds unnecessary boilerplate for all of the unimplemented base class methods.\r\n\r\nAn alternative is that you could specify the Cantera include directory using `-isystem` instead of `-I`, which will suppress warnings for files in that directory but allow you to use whatever warning flags you like for your code.\r\n"}}
{"actor":{"display_login":"speth"}}