Re: [Boost-bugs] [Boost C++ Libraries] #4527: warning in Boost.format and Boost.test C4224

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4527: warning in Boost.format and Boost.test C4224
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-13 13:42:19


#4527: warning in Boost.format and Boost.test C4224
--------------------------------------+-------------------------------------
  Reporter: pbristow | Owner: samuel_krempp
      Type: Bugs | Status: new
 Milestone: Boost 1.44.0 | Component: format
   Version: Boost Development Trunk | Severity: Cosmetic
Resolution: | Keywords: format C4224
--------------------------------------+-------------------------------------
Changes (by pbristow):

  * keywords: format C2442 => format C4224

Comment:

 Well to the hapless Boost.Math library user who just wants a quick
 Student's t value and gets a faceful of warnings in a library
 (Boost.Format) he didn't even know he was using,
 it is certainly broken!

 I'm not a language lawyer or C++ style guru, but to reuse a name a bit
 gratuitously doesn't feel the best programming style ?

 It is even simpler than your test case

 {{{

 class arg {};

  class test
  {
      int operator()(const int & arg)
      {
        return arg; // Warning 4224 - argument arg same name as class arg.
      }
  };

  class test_OK
  {
      int operator()(const int & arg1)
      {
        return arg1; // OK argument has different name from class.
      }
  };
 /*
 test_naming.cpp(5) : warning C4224: nonstandard extension used
 : formal parameter 'arg' was previously defined as a type

 Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
 */

 }}}

 I'm not clear what is the objection to the pragmatic simple change of name
 from 'arg' to anything else.

 Won't it get the problem out of our (and users) hair until MS (claiming it
 is an extension) and WG21 reach agreement if it is 'legal' or not?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4527#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC