Boost C++ Libraries: Ticket #1471: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport https://svn.boost.org/trac10/ticket/1471 <p> Hi, </p> <p> When using Boost.Regex (<a class="changeset" href="https://svn.boost.org/trac10/changeset/41287" title="Fix search for Boost.Build so that it only finds the approved version.">r41287</a>) 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 <code>strcat</code>/<code>strcpy</code>.<br /> AFAICT everything is there to avoid those warnings (i.e. to have Boost.Regex use <code>strcat_s</code>/<code>strcpy_s</code> instead)... it's just not applied in this particular case. </p> <p> One single preprocessor test in <code>boost/regex/v4/regex_workaround.hpp</code> controls two distinct things, which I think should be controlled by two separate tests. I suggest applying the attached patch (in <code>trunk/</code>), which splits that test in two: </p> <ul><li>first test (unchanged): <ul><li>if using VC8+ and the default Dinkumware STL: use custom <code>copy</code>/<code>equal</code> </li><li>otherwise: use STL <code>copy</code>/<code>equal</code> </li></ul></li><li>second test (new): <ul><li>if using VC8+ and the "secure" CRT: use CRT <code>strcat_s</code>/<code>strcpy_s</code> </li><li>otherwise: use Boost.Regex's custom <code>strcat_s</code>/<code>strcpy_s</code> </li></ul></li></ul><p> This way, <code>strcat_s</code>/<code>strcpy_s</code> 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). </p> <p> Cheers, Francois </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1471 Trac 1.4.3 Francois Barel Thu, 22 Nov 2007 17:47:09 GMT attachment set https://svn.boost.org/trac10/ticket/1471 https://svn.boost.org/trac10/ticket/1471 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">BRL-warnings.diff</span> </li> </ul> Ticket John Maddock Tue, 11 Dec 2007 17:28:15 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1471#comment:1 https://svn.boost.org/trac10/ticket/1471#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/41973" title="Fixes #1471.">[41973]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1471" title="#1471: Patches: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport (closed: fixed)">#1471</a>. </p> Ticket Eric Niebler Tue, 11 Dec 2007 22:00:09 GMT <link>https://svn.boost.org/trac10/ticket/1471#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1471#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/41984" title="Merged revisions 41954-41983 via svnmerge from ...">[41984]</a>) Merged revisions 41954-41983 via svnmerge from <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk</a> </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41955" title="Treated Rogue Wave library concept check failure on Tru64/CXX.">r41955</a> | schoepflin | 2007-12-10 05:40:56 -0800 (Mon, 10 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Treated Rogue Wave library concept check failure on Tru64/CXX. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41956" title="SunPro 5.9 can't detect lvalue returns ">r41956</a> | dave | 2007-12-10 07:19:21 -0800 (Mon, 10 Dec 2007) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> <a class="missing wiki">SunPro</a> 5.9 can't detect lvalue returns </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41957" title="changes msvc-7.1 to msvc-7.1* ">r41957</a> | t_schwinger | 2007-12-10 10:26:38 -0800 (Mon, 10 Dec 2007) | 3 lines </p> </blockquote> <p> </p> <blockquote> <p> changes msvc-7.1 to msvc-7.1* </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41966" title="Fixes #1454.">r41966</a> | johnmaddock | 2007-12-11 08:37:22 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1454" title="#1454: Patches: Minor compilation errors with g++ -pedantic (closed: fixed)">#1454</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41968" title="Fixes #1504.">r41968</a> | johnmaddock | 2007-12-11 09:16:21 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1504" title="#1504: Bugs: [type-traits] VC8 - C4512 warning (closed: fixed)">#1504</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41970" title="Fixes #1455.">r41970</a> | johnmaddock | 2007-12-11 09:19:03 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1455" title="#1455: Bugs: gcc 4.3.0 requires main to take 0 or 2 arguments (closed: fixed)">#1455</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41973" title="Fixes #1471.">r41973</a> | johnmaddock | 2007-12-11 09:28:15 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1471" title="#1471: Patches: Boost.Regex: Warnings about strcat/strcpy on VC8+STLport (closed: fixed)">#1471</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41976" title="Fixes #1474.">r41976</a> | johnmaddock | 2007-12-11 10:51:57 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1474" title="#1474: Bugs: VC++ 2008 seems to trigger multiple inclusion of boost::hash (closed: fixed)">#1474</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41979" title="Put add-usage-requirements back">r41979</a> | vladimir_prus | 2007-12-11 11:41:47 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Put add-usage-requirements back </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41980" title="Implement ISFILE for real">r41980</a> | vladimir_prus | 2007-12-11 11:45:37 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Implement ISFILE for real </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41981" title="When searching for headers, ignore directories, just like gcc does. ">r41981</a> | vladimir_prus | 2007-12-11 11:46:19 -0800 (Tue, 11 Dec 2007) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> When searching for headers, ignore directories, just like gcc does. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/41983" title="remove conditionalization for aCC: this header works with gcc on HP-UX also">r41983</a> | bgubenko | 2007-12-11 12:43:11 -0800 (Tue, 11 Dec 2007) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> remove conditionalization for aCC: this header works with gcc on HP-UX also </p> </blockquote> <p> ........ </p> </description> <category>Ticket</category> </item> </channel> </rss>