Modify

Ticket #1618 (closed Feature Requests: fixed)

Opened 6 years ago

Last modified 6 years ago

Warnings need supressing

Reported by: pbristow Owned by: 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

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

Change History

comment:1 Changed 6 years ago by Richard Webb <Richard.Webb@…>

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 Changed 6 years ago by Richard Webb <richard.webb@…>

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.

Changed 6 years ago by Richard Webb <richard.webb@…>

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

comment:3 Changed 6 years ago by turkanis

  • Status changed from new to assigned

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 Changed 6 years ago by Richard Webb <richard.webb@…>

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.

Changed 6 years ago by Richard Webb <richard.webb@…>

Changed 6 years ago by Richard Webb <richard.webb@…>

comment:5 Changed 6 years ago by turkanis

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 Changed 6 years ago by Richard Webb <richard.webb@…>

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

comment:7 Changed 6 years ago by turkanis

  • Status changed from assigned to closed
  • Resolution set to fixed

comment:8 Changed 6 years ago by Richard Webb <richard.webb@…>

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 6 years ago by turkanis

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

comment:10 Changed 6 years ago by turkanis

  • Status changed from reopened to closed
  • Resolution set to fixed

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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.