Opened 15 years ago

Closed 14 years ago

#1618 closed Feature Requests (fixed)

Warnings need supressing

Reported by: Paul A. Bristow Owned by: Jonathan Turkanis
Milestone: Boost 1.36.0 Component: iostreams
Version: Boost 1.34.1 Severity: Cosmetic
Keywords: Cc:

Description

Warnings need suppressing (at least these but probably more):

iostreams/detail/adaptor/non_blocking.hpp

#ifdef _MSC_VER # pragma warning (disable : 4512) assignment operator could not be generated #endif

iostreams\chain.hpp

#if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma warning (disable : 4127) expression is constant # pragma once #endif

Attachments (3)

ios4a.zip (154.8 KB ) - added by Richard Webb <richard.webb@…> 15 years ago.
log of iostreams tests built with vc9/w4/code analysis
traits.diff (707 bytes ) - added by Richard Webb <richard.webb@…> 14 years ago.
iostreams.zip (244.7 KB ) - added by Richard Webb <richard.webb@…> 14 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Richard Webb <Richard.Webb@…>, 15 years ago

Have you tried testing this with 1.35 / Trunk?

A lot of the warnings have already been fixed - see #1523 for an example.

comment:2 by Richard Webb <richard.webb@…>, 15 years ago

Running the iostreams tests with VC9 and warning level 4 results in a few unreferenced parameter warnings:

\boost/iostreams/filter/newline.hpp(401) : warning C4100: 'which' : unreferenced formal parameter
\boost/iostreams/filter/newline.hpp(214) : warning C4100: 'which' : unreferenced formal parameter
\boost/iostreams/filter/symmetric.hpp(155) : warning C4100: 'which' : unreferenced formal parameter

Running the tests with code analysis enabled results in loads of 'sizeof usage' warnings:

boost\iostreams\traits.hpp(49) : warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results

(which actually results from the usage of sizeof in the macro in bool_trait_def.hpp) I dont think it's really a problem, but it creates a lot of noise.

by Richard Webb <richard.webb@…>, 15 years ago

Attachment: ios4a.zip added

log of iostreams tests built with vc9/w4/code analysis

comment:3 by Jonathan Turkanis, 14 years ago

Status: newassigned

I believe the warnings 4512, 4127, and 4100 have all been addressed previously.

I am unable to reproduce 6334, either because my versions of VC (8.0 pro and 9.0 express) don't support code analysis, or because I am too stupid to figure out how to turn it on.

I have attempted to fix the problem in [45788] by disabling warning 6334 around invocations of BOOST_IOSTREAMS_BOOL_TRAIT_DEF in traits.hpp and detail/is_iterator_range.hpp.

Please let me know if this resolves the issue. If not, please generate another log of VC output using the current trunk.

comment:4 by Richard Webb <richard.webb@…>, 14 years ago

Thats fixed some of the 6334s. but there are some left (from other BOOST_IOSTREAMS_BOOL_TRAIT_DEF uses, and from BOOST_SELECT_BY_SIZE).

Moving the 'pragma warning(pop)' further down the file silences those.

by Richard Webb <richard.webb@…>, 14 years ago

Attachment: traits.diff added

by Richard Webb <richard.webb@…>, 14 years ago

Attachment: iostreams.zip added

comment:5 by Jonathan Turkanis, 14 years ago

Okay, I've moved the code suppressing 6334 into detail/config/disable_warnings.hpp and included that file in traits.hpp and is_iterator_range.hpp. This should cover all the code in those two files (see [45843])

comment:6 by Richard Webb <richard.webb@…>, 14 years ago

Ok, that seems to have got them all now :)

comment:7 by Jonathan Turkanis, 14 years ago

Resolution: fixed
Status: assignedclosed

comment:8 by Richard Webb <richard.webb@…>, 14 years ago

Resolution: fixed
Status: closedreopened

Looking at the test results (e.g. http://tinyurl.com/5jawvj), i notice that there is now an extra warning on VC7.1 because C6334 only exists on VC8+:

boost\iostreams\detail\config\disable_warnings.hpp(19) : warning C4616: #pragma warning : warning number '6334' out of range, must be between '4001' and '4999'

This can be fixed by only disabling 6334 on visual studio 8 or newer. Sorry for not thinking of this earlier.

comment:9 by Jonathan Turkanis, 14 years ago

(In [46394]) limitted disabling of compiler warning 6334 to VC8.0+ (see #1618)

comment:10 by Jonathan Turkanis, 14 years ago

Resolution: fixed
Status: reopenedclosed

That's funny. I remember planning to test "pragma warning(disable:9999)" on VC8.0 to see if it produced an "unknown warning" warning -- in fact, I thought I had done so.

I've now disabled the warning only if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) (See #1618). I'm assuming this works, and re-closing the ticket.

Thanks for all your help, Richard.

Note: See TracTickets for help on using tickets.