#7049 closed Bugs (fixed)
"unreferenced parameter" warning
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
There is an unreferenced parameter which results in a compiler-warning at the following location:
File: "boost/program_options/errors.hpp" Line: 253 Function: "set_option_name"
The parameter "option_name" is not referenced which results in the following compiler-warning in Visual Studio 2010 when compiling one's code using program_options:
".../boost/program_options/errors.hpp(253): warning C4100: 'option_name' : unreferenced formal parameter"
(In other compilers a similar warning will probably occur.)
A small patch which fixes the problem is attached.
Attachments (1)
Change History (6)
by , 10 years ago
Attachment: | errors.hpp.patch added |
---|
comment:1 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
I also find this problem with gcc when using "-Werror -Wall -Wextra". Have just checked the trunk and it appears that the patch didn't quite work. The line in question (253) is still:
virtual void set_option_name(const std::string&option_name) {}
My solution was to simply remove "option_name" from this line.
comment:3 by , 10 years ago
@garren: You are right. Actually my patch should change the line into:
virtual void set_option_name(const std::string& /* option_name */){}
Either my patch-file had the wrong format, or something got mixed up while patching. At least, this is what it should look like.
Patch that fixes the "unreferenced parameter" warning.