#1471 closed Patches (fixed)
Boost.Regex: Warnings about strcat/strcpy on VC8+STLport
Reported by: | Francois Barel | Owned by: | John Maddock |
---|---|---|---|
Milestone: | To Be Determined | Component: | regex |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
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
.
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
- if using VC8+ and the default Dinkumware STL: use custom
- 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
- if using VC8+ and the "secure" CRT: use CRT
This way, strcat_s
/strcpy_s
get used when available, even if the first test is false (when not using Dinkumware STL).
That patch has worked for me on both VC8 (SP1) and VC9 (beta 2).
Cheers, Francois
Attachments (1)
Change History (3)
by , 15 years ago
Attachment: | BRL-warnings.diff added |
---|
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
(In [41984]) Merged revisions 41954-41983 via svnmerge from https://svn.boost.org/svn/boost/trunk
........
r41955 | schoepflin | 2007-12-10 05:40:56 -0800 (Mon, 10 Dec 2007) | 1 line
Treated Rogue Wave library concept check failure on Tru64/CXX.
........
r41956 | dave | 2007-12-10 07:19:21 -0800 (Mon, 10 Dec 2007) | 2 lines
SunPro 5.9 can't detect lvalue returns
........
r41957 | t_schwinger | 2007-12-10 10:26:38 -0800 (Mon, 10 Dec 2007) | 3 lines
changes msvc-7.1 to msvc-7.1*
........
r41966 | johnmaddock | 2007-12-11 08:37:22 -0800 (Tue, 11 Dec 2007) | 1 line
Fixes #1454.
........
r41968 | johnmaddock | 2007-12-11 09:16:21 -0800 (Tue, 11 Dec 2007) | 1 line
Fixes #1504.
........
r41970 | johnmaddock | 2007-12-11 09:19:03 -0800 (Tue, 11 Dec 2007) | 1 line
Fixes #1455.
........
r41973 | johnmaddock | 2007-12-11 09:28:15 -0800 (Tue, 11 Dec 2007) | 1 line
Fixes #1471.
........
r41976 | johnmaddock | 2007-12-11 10:51:57 -0800 (Tue, 11 Dec 2007) | 1 line
Fixes #1474.
........
r41979 | vladimir_prus | 2007-12-11 11:41:47 -0800 (Tue, 11 Dec 2007) | 1 line
Put add-usage-requirements back
........
r41980 | vladimir_prus | 2007-12-11 11:45:37 -0800 (Tue, 11 Dec 2007) | 1 line
Implement ISFILE for real
........
r41981 | vladimir_prus | 2007-12-11 11:46:19 -0800 (Tue, 11 Dec 2007) | 2 lines
When searching for headers, ignore directories, just like gcc does.
........
r41983 | bgubenko | 2007-12-11 12:43:11 -0800 (Tue, 11 Dec 2007) | 1 line
remove conditionalization for aCC: this header works with gcc on HP-UX also
........
(In [41973]) Fixes #1471.