From: sashan Date: Tue, 3 Jun 2025 13:12:48 +0000 (+0200) Subject: Document transition from ANSI-C towards C-99 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=53e5071f3402ef0ae52f583154574ddd5aa8d3d7;p=thirdparty%2Fopenssl.git Document transition from ANSI-C towards C-99 The existing NOTES-ANSI.md are renamed to NOTES-C99.md and updated accordingly. INSTALL.md lists C-99 compiler instead of ANSI-C now. Also moving from ANSI-C to C-99 warrants updates to NEWS.md and CHANGES.md. Reviewed-by: Richard Levitte Reviewed-by: Neil Horman Reviewed-by: Tom Cosgrove (Merged from https://github.com/openssl/openssl/pull/27751) --- diff --git a/CHANGES.md b/CHANGES.md index 0261d880307..00bf0c7861e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -31,6 +31,11 @@ OpenSSL 3.6 ### Changes between 3.5 and 3.6 [xx XXX xxxx] + * An ANSI-C toolchain is no longer sufficient for building OpenSSL. The code + should build on compilers supporting C-99 features. + + *Alexandr Nedvedicky* + * The VxWorks platforms have been removed. These platforms were unadopted, unmaintained and reported to be non-functional. diff --git a/INSTALL.md b/INSTALL.md index 983f6aad136..cb54c7ea717 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -51,7 +51,7 @@ To install OpenSSL, you will need: * A "make" implementation * Perl 5 with core modules (please read [NOTES-PERL.md](NOTES-PERL.md)) * The Perl module `Text::Template` (please read [NOTES-PERL.md](NOTES-PERL.md)) - * an ANSI C compiler + * a C-99 compiler * POSIX C library (at least POSIX.1-2008), or compatible types and functionality. * a development environment in the form of development libraries and C diff --git a/NEWS.md b/NEWS.md index f7ca106e3b1..78b872efbd4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -28,6 +28,9 @@ OpenSSL 3.5 This release incorporates the following potentially significant or incompatible changes: + * An ANSI-C toolchain is no longer sufficient for building OpenSSL. The code + should build on compilers supporting C-99 features. + * The VxWorks platforms have been removed. * Added an `openssl configutl` utility for processing the openssl diff --git a/NOTES-ANSI.md b/NOTES-ANSI.md deleted file mode 100644 index feeb5434855..00000000000 --- a/NOTES-ANSI.md +++ /dev/null @@ -1,33 +0,0 @@ -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. diff --git a/NOTES-C99.md b/NOTES-C99.md new file mode 100644 index 00000000000..ad3be43b619 --- /dev/null +++ b/NOTES-C99.md @@ -0,0 +1,22 @@ +Notes on C-99 +============= + +This file contains a list of C-99 features we don't allow for OpenSSL. +Starting with 3.6 OpenSSL project is going to gradually adopt C-99 features. +The plan is to bring those features in small steps. Either with new +code where particular C-99 construct makes sense (think of designated initializers), +or when refactoring existing code and using C-99 language feature improves +readability/maintainability of the code. C-99 seems to be implemented by major +compilers ([clang](https://clang.llvm.org/c_status.html#c99), [gcc](https://gcc.gnu.org/c99status.html), [msvc](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170)), therefore we can opt +for permissive policy to adopt C-99 standard. This approach means OpenSSL +project accepts all C-99 features except those explicitly listed here. +The list here is going to be updated by features we either + + - find not useful (or not a good match) for OpenSSL + + - the feature is not implemented by some non-mainstream compiler which + we need to keep supported for benefit of OpenSSL users + +The list of C-99 features we don't support in OpenSSL project follows: + + - do not use `//` for comments, stick to `/* ... */`