Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22192

__STDC_LIB_EXT1__ availability in gcc and clang

$
0
0

Since a quick Google search did not find anything, I will try to ask here (since many people involved in gcc/clang hang around here) - What is the status of __STDC_LIB_EXT1__ in gcc/clang? We are developing a cross platform application and I wanted to use some of the safe bounds checking functions from <stdio.h> (which by miracle are available on Visual Studio 2017), but could not compile the code with Xcode 9.2. I assumed maybe the clang version Xcode uses is outdated, but gcc 6.3.0 on Ubuntu behaves the same. I am trying to use tmpnam_s with the following sample:

#if defined(__STDC_LIB_EXT1__)#define  __STDC_WANT_LIB_EXT1__ 1#include <stdio.h>#else#error "__STDC_LIB_EXT1__ not defined"#endifint main(int argc, char** argv){    char t[L_tmpnam_s];     tmpnam_s(t, L_tmpnam_s);    return 0;}

But the compilation fails with the macro not being defined:

gcc -std=c11 test.ctest.c:5:2: error: #error "__STDC_LIB_EXT1__ not defined"#error "__STDC_LIB_EXT1__ not defined"^~~~~

Am I doing something wrong or this function set is simply poorly supported?


Viewing all articles
Browse latest Browse all 22192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>