summaryrefslogtreecommitdiffstats
path: root/NOTES-ANSI.md
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2024-04-17 13:56:26 +0200
committerTomas Mraz <tomas@openssl.org>2024-05-22 09:59:32 +0200
commit4e8c4b77ef7480b80de1971d8862300c366015e9 (patch)
treedc9109da1c88f3dbf32f6cceb48ac1da57fd31fc /NOTES-ANSI.md
parentWhen defining ossl_ssize_t = ssize_t, remember to include sys/types.h (diff)
downloadopenssl-4e8c4b77ef7480b80de1971d8862300c366015e9.tar.xz
openssl-4e8c4b77ef7480b80de1971d8862300c366015e9.zip
Add installation documentation and notes on ANSI C and POSIX
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24173)
Diffstat (limited to 'NOTES-ANSI.md')
-rw-r--r--NOTES-ANSI.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/NOTES-ANSI.md b/NOTES-ANSI.md
new file mode 100644
index 0000000000..feeb543485
--- /dev/null
+++ b/NOTES-ANSI.md
@@ -0,0 +1,33 @@
+Notes on ANSI C
+===============
+
+When building for pure ANSI C (C89/C90), you must configure with at least
+the following configuration settings:
+
+- `no-asm`
+
+ There are cases of `asm()` calls in our C source, which isn't supported
+ in pure ANSI C.
+
+- `no-secure-memory`
+
+ The secure memory calls aren't supported with ANSI C.
+
+- `-D_XOPEN_SOURCE=1`
+
+ This macro enables the use of the following types, functions and global
+ variables:
+
+ - `timezone`
+
+- `-D_POSIX_C_SOURCE=200809L`
+
+ This macro enables the use of the following types, functions and global
+ variables:
+
+ - `ssize_t`
+ - `strdup()`
+
+It's arguable that with gcc and clang, all of these issues are removed when
+defining the macro `_DEFAULT_SOURCE`. However, that effectively sets the C
+language level to C99, which isn't ANSI C.