Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7049 closed Bugs (fixed)

"unreferenced parameter" warning

Reported by: Deniz Bahadir <D.Bahadir@…> 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)

errors.hpp.patch (472 bytes ) - added by Deniz Bahadir <D.Bahadir@…> 10 years ago.
Patch that fixes the "unreferenced parameter" warning.

Download all attachments as: .zip

Change History (6)

by Deniz Bahadir <D.Bahadir@…>, 10 years ago

Attachment: errors.hpp.patch added

Patch that fixes the "unreferenced parameter" warning.

comment:1 by Vladimir Prus, 10 years ago

Resolution: fixed
Status: newclosed

(In [79164]) Fix compilation error.

Fixes #7049. Patch from Deniz Bahadir.

comment:2 by garren@…, 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 Deniz Bahadir <D.Bahadir@…>, 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.

comment:4 by Vladimir Prus, 10 years ago

(In [79477]) Really fixes #7049.

comment:5 by Vladimir Prus, 10 years ago

(In [82556]) Merge: Really fixes #7049.

Note: See TracTickets for help on using tickets.