Home | History | Annotate | Line # | Download | only in dist
      1  1.1  christos Notes on ANSI C
      2  1.1  christos ===============
      3  1.1  christos 
      4  1.1  christos When building for pure ANSI C (C89/C90), you must configure with at least
      5  1.1  christos the following configuration settings:
      6  1.1  christos 
      7  1.1  christos -   `no-asm`
      8  1.1  christos 
      9  1.1  christos     There are cases of `asm()` calls in our C source, which isn't supported
     10  1.1  christos     in pure ANSI C.
     11  1.1  christos 
     12  1.1  christos -   `no-secure-memory`
     13  1.1  christos 
     14  1.1  christos     The secure memory calls aren't supported with ANSI C.
     15  1.1  christos 
     16  1.1  christos -   `-D_XOPEN_SOURCE=1`
     17  1.1  christos 
     18  1.1  christos     This macro enables the use of the following types, functions and global
     19  1.1  christos     variables:
     20  1.1  christos 
     21  1.1  christos     -   `timezone`
     22  1.1  christos 
     23  1.1  christos -   `-D_POSIX_C_SOURCE=200809L`
     24  1.1  christos 
     25  1.1  christos     This macro enables the use of the following types, functions and global
     26  1.1  christos     variables:
     27  1.1  christos 
     28  1.1  christos     -   `ssize_t`
     29  1.1  christos     -   `strdup()`
     30  1.1  christos 
     31  1.1  christos It's arguable that with gcc and clang, all of these issues are removed when
     32  1.1  christos defining the macro `_DEFAULT_SOURCE`.  However, that effectively sets the C
     33  1.1  christos language level to C99, which isn't ANSI C.
     34