Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>strcpy_s()</code> function is defined in TR 24731-1 (see <a href="https://stackoverflow.com/questions/372980/do-you-use-the-tr-24731-safe-functions">Do you use the TR 24731 'safe' functions</a>), and also in optional Annex K of ISO/IEC 9899:2011 (the C 2011 standard).</p> <p>You can test whether your implementation supports it with:</p> <blockquote> <p><code>__STDC_LIB_EXT1__</code> The integer constant 200509L, intended to indicate conformance to this Technical Report.</p> </blockquote> <p>(according to the TR). Annex K simply says:</p> <blockquote> <p>An implementation that defines <code>__STDC_LIB_EXT1__</code> shall conform to the specifications in this annex.<sup>380)</sup></p> <p><sup>380)</sup> Implementations that do not define <code>__STDC_LIB_EXT1__</code> are not required to conform to these specifications.</p> </blockquote> <p><em>This <a href="https://stackoverflow.com/a/16700951/15168">answer</a> indicates that the TC1 (Technical Corrigenda 1) for the C 2011 standard defines that <code>__STDC_LIB_EXT1__</code> should be 201112L (Dec 2011) for the Annex K version of the functions. I've not tracked whether there are differences between Annex K and TR 24731-1.</em></p> <p>So, you should be able to test whether your library supports <code>strcpy_s()</code> by testing <code>__STDC_LIB_EXT1__</code>, but it is optional. There was apparently a statement by Ulrich Drepper that the GNU C Library would not support the TR 24731-1 functions; I don't know whether that still holds.</p> <p>Also, be aware that the Microsoft interfaces to some of these functions is different from the standard interfaces to the same function (<code>vsnprintf_s()</code>, for example). That limits their usefulness as a cross-platform portability tool.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload