Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

C11 Annex K  introduced the new type errno_t that is defined to be type int in errno.h and elsewhere. Many of the functions defined in C11 Annex K return values of this type [ISO/IEC 9899:2011]. The errno_t type should be used as the type of an object that may contain only values that might be found in errno. For example, a function that returns the value of errno should be declared as having the return type errno_t.

This recommendation depends on C11 Annex K being implemented.   The following code can be added to remove this dependency:

...

Code Block
languagecpp
#ifndef __STDC_LIB_EXT1__
  typedef int errno_t;
#endif

 

...

Bibliography

[ISO/IEC 9899:2011]Subclause K.3.2, "Errors <errno.h>"
[Open Group 2004] 

...