Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1416 closed Bugs (fixed)

Warnings from Boost.Function need suppression.

Reported by: Paul A. Bristow Owned by: Douglas Gregor
Milestone: To Be Determined Component: function
Version: Boost Development Trunk Severity: Problem
Keywords: warnings function Cc:

Description

Using (in directly via Boost.Parameter?)

sparks dozens of MSVC 4224 warnings with MSVC at level 1

Error Message nonstandard extension used : formal parameter 'identifier' was previously defined as a type

The identifier was previously used as a typedef. This causes a warning under ANSI compatibility (/Za).

Example

Copy Code

C4224.cpp compile with: /Za /W1 /LD typedef int I; void func ( int I ); C4224 Please could these be suppressed (or a variable name changed to avoid this?)

# pragma warning(disable : 4224) nonstandard extension used : formal parameter 'function_ptr' was previously defined as a type

i:\trunk\boost/function/function_template.hpp(92) : warning C4224: nonstandard extension used : formal parameter 'function_ptr' was previously defined as a type

i:\trunk\boost/function/function_template.hpp(97) : see reference to class template instantiation 'boost::detail::function::function_invoker0<FunctionPtr,R>' being compiled

Attachments (1)

function_template.patch (819 bytes ) - added by Richard Webb <Richard.Webb@…> 15 years ago.

Download all attachments as: .zip

Change History (5)

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

(I don't know if i should add this here, or open a new bug - so tell me if i'm wrong):

Building my project in VC8SP1 on warning level 4 results in some C4127 (conditional expression is constant) warnings from function_template.hpp:

if (function_allows_small_object_optimization<FunctionObj>::value)
...

The attached patch silences the warning on VC8.

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

Attachment: function_template.patch added

comment:2 by Douglas Gregor, 15 years ago

Resolution: fixed
Status: newclosed

(In [41798]) Disable more Visual C++ warnings in Function headers. Fixes #1416

comment:3 by Eric Niebler, 15 years ago

(In [41915]) Merged revisions 41776-41815 via svnmerge from https://svn.boost.org/svn/boost/trunk

........

r41778 | bgubenko | 2007-12-06 02:47:52 -0800 (Thu, 06 Dec 2007) | 1 line

compute 'result' in to_ulong() as it is done in Boost 1.34

........

r41788 | vladimir_prus | 2007-12-06 08:00:38 -0800 (Thu, 06 Dec 2007) | 2 lines

Add Google Analytics tracking code for the uploaded docs.

........

r41789 | vladimir_prus | 2007-12-06 08:12:01 -0800 (Thu, 06 Dec 2007) | 3 lines

Fix search for html files. Put packages where beta.boost.org can fetch them.

........

r41791 | vladimir_prus | 2007-12-06 08:23:39 -0800 (Thu, 06 Dec 2007) | 1 line

Fix quoting

........

r41795 | dgregor | 2007-12-06 09:17:38 -0800 (Thu, 06 Dec 2007) | 4 lines

Bump VC++ version check to continue applying VC-specific workaround for Visual C++ 9.0. Fixes #1499

........

r41798 | dgregor | 2007-12-06 10:39:06 -0800 (Thu, 06 Dec 2007) | 3 lines

Disable more Visual C++ warnings in Function headers. Fixes #1416

........

r41801 | guwi17 | 2007-12-06 11:21:31 -0800 (Thu, 06 Dec 2007) | 3 lines

  • fix and close #1502
  • the return types were not correct: there was A instead of indirect_array<A>

........

r41802 | dgregor | 2007-12-06 11:22:06 -0800 (Thu, 06 Dec 2007) | 4 lines

Workaround for MPICH to properly deal with SEEK_* constants. Fixes #1486

........

r41805 | t_schwinger | 2007-12-06 13:25:10 -0800 (Thu, 06 Dec 2007) | 3 lines

annotates on msvc 7.1 overload selection bug in function_types example

........

comment:4 by Douglas Gregor, 15 years ago

(In [42031]) Merged fixes for Function, Signals, and MPI from trunk. See #1499, see #1416, see #1486

Note: See TracTickets for help on using tickets.