#4015 closed Patches (fixed)
[PATCH] boost/program_options gcc warning cleanup
Reported by: | 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 )
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)
Change History (9)
by , 13 years ago
Attachment: | boost_program_options_gcc_warning_cleanup.diff added |
---|
comment:1 by , 13 years ago
comment:4 by , 13 years ago
No, they're different v's. There's both a member and a parameter called v.
comment:5 by , 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 , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 12 years ago
While I hate warning options that are broken, -Wshadow seems generally useful to catch issues, so I've applied the patch.
Sorry, but I think that whatever warning option causes gcc to warn about "v(v)" style of member initializers is a broken warning option.