summaryrefslogtreecommitdiff
path: root/Lib/stdint.i
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-04-23 12:10:21 +1200
committerOlly Betts <olly@survex.com>2023-04-27 10:08:57 +1200
commit1f5ff2e6a585d0b5dca501945fabfeb48b1bf547 (patch)
tree8e89ad3733384a7dc952b74a8243562bee3cb85e /Lib/stdint.i
parent589373309dae750ed05a46b1b955993da253a287 (diff)
downloadswig-1f5ff2e6a585d0b5dca501945fabfeb48b1bf547.tar.gz
Allow using snprintf() instead of sprintf() in wrappers
We aim to produce code that works with C90 or C++98 so we can't assume snprintf() is available, but it almost always is (even on systems from before it was standardised) so having a way to use it is helpful. Enable this automatically if the compiler claims conformance with at least C90 or C++98 and check SWIG_HAVE_SNPRINTF to allow turning on manually, but disable if SWIG_NO_SNPRINTF if defined. The fallback is to call sprintf() without a buffer size check - checking after the call is really shutting the stable door after the horse has bolted, and most of our uses either have a fixed maximum possible size or dynamically allocate a buffer that's large enough. Fixes: #2502 (sprintf deprecation warnings on macos) Fixes: #2548
Diffstat (limited to 'Lib/stdint.i')
0 files changed, 0 insertions, 0 deletions