Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#4015 closed Patches (fixed)

[PATCH] boost/program_options gcc warning cleanup

Reported by: Tatu Kilappa <tatu.kilappa@…> Owned by: Vladimir Prus
Milestone: Boost 1.43.0 Component: program_options
Version: Boost Development Trunk Severity: Cosmetic
Keywords: gcc warning Cc:

Description (last modified by Marshall Clow)

Patch to clean up excessive gcc 4.x warning barf.

To reproduce, compile any program_options-using program with: -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Werror=return-type -Wextra -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wno-multichar -Wpacked -Wredundant-decls -Wshadow -Wswitch-default -Wundef -Wwrite-strings -Wctor-dtor-privacy -Werror=non-virtual-dtor -Woverloaded-virtual

Attached patch fixes the issue.

Attachments (1)

boost_program_options_gcc_warning_cleanup.diff (5.5 KB ) - added by Tatu Kilappa <tatu.kilappa@…> 13 years ago.

Download all attachments as: .zip

Change History (9)

by Tatu Kilappa <tatu.kilappa@…>, 13 years ago

comment:1 by Vladimir Prus, 13 years ago

Sorry, but I think that whatever warning option causes gcc to warn about "v(v)" style of member initializers is a broken warning option.

comment:2 by Steven Watanabe, 13 years ago

I'm guessing that it's -Wshadow.

comment:3 by Marshall Clow, 13 years ago

Description: modified (diff)

Really? I would have guessed -Winit_self.

comment:4 by Steven Watanabe, 13 years ago

No, they're different v's. There's both a member and a parameter called v.

comment:5 by Tatu Kilappa <tatu.kilappa@…>, 13 years ago

The option causing the warning is indeed -Wshadow. The warnings are caused simply by function parameters that are of the same name as class members.

I'm using that option all the time to prevent myself from doing anything stupid, but its Vladimir's library and if he disagrees, then that's pretty much that. Then just conclude this with 'wontfix'.

And if thus, is there a GCC option that can have it ignore warnings inside certain headers or is the only option to do a lot of script magic?

comment:6 by Vladimir Prus, 12 years ago

Resolution: fixed
Status: newclosed

(In [62236]) Fix -Wshadow warnings. Closes #4015. Patch from Tatu Kilappa.

comment:7 by Vladimir Prus, 12 years ago

While I hate warning options that are broken, -Wshadow seems generally useful to catch issues, so I've applied the patch.

comment:8 by tatu.kilappa@…, 12 years ago

Thanks, I appreciate this.

Note: See TracTickets for help on using tickets.