-
Notifications
You must be signed in to change notification settings - Fork 141
Reject unsupported flags #936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reject unsupported flags #936
Conversation
425e801 to
7be67e9
Compare
|
There is a problem that this change is in itself a breaking change. Might be fine though? |
|
I agree, but it seems the only proper behavior (see the description). Currently some functions follow this behavior and other do not. This MR makes the behavior consistent across the code base. |
87ac7f4 to
b5ff4e9
Compare
whot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem that this change is in itself a breaking change. Might be fine though?
IMO it's fine - functions not checking their arguments is not something a caller should be relying on.
Code LGTM though I think the various enums are unnecessary (see my inline comments). Thanks for fixing this.
|
|
||
| found_path: | ||
| ok = parse_file(table, file, path); | ||
| {} /* Label followed by a declaration is a C23 extension */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work?
found_path:
{
const bool ok ...
flcose
if (!ok) {
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will work, it’s just that I have some hope to switch to C23 for the basic features: constexpr and attributes would be great appart lifting this label restriction!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave this up to you then, whichever you prefer. all LGTM now, thanks
b5ff4e9 to
c9231a2
Compare
|
Rebased & applied review |
c9231a2 to
3d56a18
Compare
Fail whenever an unsupported flag is used. See the discussion in #932
See also #942 to check valid flags properly.
@bluetech @whot this is probably better to fail explicitly (and early) rather than lie to the user.
It also enable indirectly to check for supported flags.
TODO: