[Boost-bugs] [Boost C++ Libraries] #1471: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport

Subject: [Boost-bugs] [Boost C++ Libraries] #1471: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-22 17:46:35


#1471: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport
-------------------------------------+--------------------------------------
 Reporter: Francois Barel | Owner: johnmaddock
     Type: Patches | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 Hi,

 When using Boost.Regex (r41287) with MSVC8 SP1 and a non-default STL
 (STLport v5.1.4), I have VC8's usual warnings about the use of the
 "unsafe" CRT functions {{{strcat}}}/{{{strcpy}}}.[[br]]
 AFAICT everything is there to avoid those warnings (i.e. to have
 Boost.Regex use {{{strcat_s}}}/{{{strcpy_s}}} instead)... it's just not
 applied in this particular case.


 One single preprocessor test in {{{boost/regex/v4/regex_workaround.hpp}}}
 controls two distinct things, which I think should be controlled by two
 separate tests.
 I suggest applying the attached patch (in {{{trunk/}}}), which splits that
 test in two:
   * first test (unchanged):
     * if using VC8+ and the default Dinkumware STL: use custom
 {{{copy}}}/{{{equal}}}
     * otherwise: use STL {{{copy}}}/{{{equal}}}
   * second test (new):
      * if using VC8+ and the "secure" CRT: use CRT
 {{{strcat_s}}}/{{{strcpy_s}}}
      * otherwise: use Boost.Regex's custom {{{strcat_s}}}/{{{strcpy_s}}}

 This way, {{{strcat_s}}}/{{{strcpy_s}}} get used when available, even if
 the first test is false (when not using Dinkumware STL).[[br]]
 That patch has worked for me on both VC8 (SP1) and VC9 (beta 2).

 Cheers,
 Francois

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1471>
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:49:57 UTC