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