Repository navigation
C front-end fixes - #625
Open
xavierleroy wants to merge 5 commits into
Open
xavierleroy wants to merge 5 commits into
xavierleroy wants to merge 5 commits into
Conversation
Evaluating both arguments of `||` and `&&` before checking their Boolean values leads to rejecting e.g. `1 || (1/0)` and `0 || (1/0)`, despite these expressions having well-defined, constant values. Also, the previous implementation of Ceval mis-handled arguments of `||`/'&&' that are 64-bit integers. E.g. `(1ULL << 32) && 1` was 0 instead of the correct 1.
…targets For format `p` and modifiers `z` and `t`, 64-bit platforms use `Vlong` values while 32-bit platforms use `Vint` values. Let's handle both.
If a struct or union is volatile and has a member of array type `t[N]`, accessing this member must add the volatile modifier not just to the type `t[N]` but also to the type `t`. Otherwise, the decay of `t[N]` to `*t` loses the volatile information. This was correctly done in the unverified elaborator (cparse/) but not in the verified type-checker (cfrontend/Ctyping.v).
If a plain string literal is concatenated with a wide empty literal, the plain string becomes a wide string.
A literal of small unsigned integer type is still promoted to `signed int`. The only case where it makes a difference is u16 character literals and wide character literals on platforms where `wchar_t` is `unsigned short`.
This was referenced Nov 22, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes one significant issue with array members of volatile structs and unions, plus some minor departures from the C11 standard.
Several of these issues were reported by Christos Papakonstantinou (Cantina Security).