Bug 65999 - c11 compliance - fopen_s not supported
Summary: c11 compliance - fopen_s not supported
Status: RESOLVED MOVED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 5.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 01:07 UTC by Michael Darling
Modified: 2015-05-04 03:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Darling 2015-05-04 01:07:00 UTC
Microsoft implemented fopen_s some time ago.  According to http://en.cppreference.com/w/c/io/fopen, it was made part of the C11 standard.  (Forgive me if they're wrong.)

GCC v5.1.0 doesn't seem to support it.  grep fopen_s -r * through its source finds nothing.  grep'ing through /usr/include (gcc 4.9.2) and /usr/local/include (gcc 5.1.0) only finds it in /usr/include/wine/msvcrt/{stdio.h & wchar.h}
Comment 1 Andrew Pinski 2015-05-04 03:00:45 UTC
These should be provided by your libc if at all.

Also note the _s functions are an optional part of C11 and are not required.
Comment 2 Andrew Pinski 2015-05-04 03:02:49 UTC
(In reply to Andrew Pinski from comment #1)
> These should be provided by your libc if at all.

This means report it to glibc if you use GNU/Linux.  Apple if you use Mac OS X, etc.