Opened 11 years ago

Closed 6 years ago

#5892 closed Support Requests (wontfix)

Why using pragma instead of fixing simple warnings?

Reported by: christophe vial <cvial@…> Owned by: Emil Dotchevski
Milestone: To Be Determined Component: exception
Version: Boost 1.47.0 Severity: Cosmetic
Keywords: Cc:

Description

In boost/exception/detail/error_info_impl.hpp, a gnu pragma was added to hide a warning that seems to be simple to fix (changing a member function argument name so it does not hide a member with the same name).

I can understand using pragma for things which are complex and will take time and effort to fix, but should we use the pragma for simple cases too?

I don't think that was the intent of the document: https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines.

This may seem cosmetic, but for the long term it could impact the overall quality if pragma proliferate and hide real issues.

Thanks, Christophe

Change History (5)

comment:1 by christophe vial <cvial@…>, 11 years ago

Actually the issue is of course the combination of

boost/exception/detail/error_info_impl.hpp

and

boost/exception/info.hpp

in reply to:  description comment:2 by Emil Dotchevski, 11 years ago

Replying to christophe vial <cvial@…>:

<snip> This may seem cosmetic, but for the long term it could impact the overall quality if pragma proliferate and hide real issues.

In practice, it is impossible to "fix" all warnings on all platforms, plus some warnings fly in the face of conscious design decisions and thus can't be "fixed" without compromising the design. A "good" fix would be to disable specific warnings, but GCC does not support that. The only alternative is to disable all warnings, and rely on an extensive framework of tests to ensure correct behavior.

Emil

comment:3 by christophe vial <cvial@…>, 11 years ago

As I said, I do understand that it is not possible in all the cases.

But is there any guidelines about which warning should be fixed and which should be hidden?

boost/include/boost_1_41_0/boost/exception/info.hpp:28: error: declaration of 'value' shadows a member of 'this'

This one seems quite simple enough to fix.

Thanks, Christophe

comment:4 by Emil Dotchevski, 11 years ago

I am trying to provide a warning-free experience for the user. If you see warnings, please provide compiler version and exact command line and I'll do my best to remove the warnings.

comment:5 by Emil Dotchevski, 6 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.