Switch to C99 without the features that became optional in C11#50
Switch to C99 without the features that became optional in C11#50kroeckx wants to merge 1 commit intoopenssl:masterfrom
Conversation
| The version of C defined in ISO/IEC 9899:1999 (C99) should be used. | ||
| Features that became optional in ISO/IEC 9899:2011 (C11) should not be used. |
There was a problem hiding this comment.
Should this change apply to 3.1 and newer releases only?
There was a problem hiding this comment.
That was at least the intention. How do we handle such changes in other policies? just add some text saying it only applies to 3.1 and later?
There was a problem hiding this comment.
just add some text saying it only applies to 3.1 and later?
Yes, I think so.
|
How do we handle old compilers, on platforms where there isn't any choice? Will it be sufficient to add compatibility functions and macros, or are we thinking of supporting syntactic things that just aren't possible on those (for example, field specifiers when setting the value of a union)? |
|
We already have compatibility for such platforms. We have plenty of code that's there just because we want to use C99 and C11 features that are not available on all platforms. But as far as I know, we don't have a platform in our platform lists that doesn't support C99, which includes things like Sun C and djgpp. This change in policy will allow us to remove such compatibility. |
|
I don't believe that there are any C99 features that are sufficiently important to move forward to that language version. |
|
What are the features in C99 we actually want? Taking a list of features from Wikipedia:
We already have our own macro for this.
Would be nice, but major stylistic change, so probably undesirable.
Bool would be nice and easily polyfilled on platforms which don't have it. Complex probably has poor support and I can't see us needing it. long long we already use. This doesn't really buy us anything and probably has poor support.
Would be nice, but major stylistic change, so probably undesirable.
We use our own implementation of printf in BIO, so this doesn't really matter to us.
Would be nice but not a game-changer. I think we would need to survey support on our target platforms (VMS, NonStop, ...)
Probably the most useful thing in C99 for us. This only affects the preprocessor. Desirable. We can use a macro for this so we can compile it out on platforms that don't support it. We can adopt this whether or not we adopt C99 in general. I think aside from creating an |
|
Personally I like boolean, declaring cycle variables inside the cycle itself and //-style comments. |
We already need and use it on 32 bit platforms for 64 bit numbers. (And yeah mostly as a typedef to int64_t) |
These two would be useful, but seriously precludes older compilers / pre-processors, as these are syntax features that can't be replicated with smart functions or macros... |
|
My understanding of the current situation is that we currently use those unconditionally:
We use those conditionally:
Things that look useful that we currently don't use:
Things that some people might want to use:
|
|
I doubt Unicode is of use to us. |
There's an issue for that (and some preliminary discussion on C99) already in openssl/openssl#17494. Also, nonstop would be fine with C99 based on this comment. Sidenote: this PR should probably have "Closes #33" in the OP. |
|
It has the closes (fixes) in the commit message. |
|
Unicode support is something that can be useful in the apps, but to properly use it we probably also need something like iconv(). |
|
An alternative could be that we list which C99 features that we require. |
Discussed on OTC meeting 2022-05-24 OTC: We think that this is the only way forward. Approving C99 as a whole does not work for supporting older platforms that we still want to support. |
|
OTC: Kurt, please either call a vote on this or write an alternative proposal. |
|
@kroeckx ping |
|
OTC: vote has not been called. Closing. |
No description provided.