-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Fixes: Can not use C99 function names as variable names in C89 #129979
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
Draft
vinay-deshmukh
wants to merge
12
commits into
llvm:main
Choose a base branch
from
vinay-deshmukh:vinay-issue-15522-c89
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−0
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e9c7869
add failing test
vinay-deshmukh 966aa6a
Update test to `expect-no-diagnostics`
vinay-deshmukh 28c5871
Add exclusion for C89 / math.h functions
vinay-deshmukh 6e79058
clang-format
vinay-deshmukh 160d719
exclude c99 symbols from builtins when std=c89
vinay-deshmukh 7572c21
clang-format
vinay-deshmukh 0afb18c
Allow __builtin_ prefixes
vinay-deshmukh 6b05ad8
__clang_
vinay-deshmukh 951bff3
Revert "__clang_"
vinay-deshmukh 9a6d3a8
__arm
vinay-deshmukh fc05614
only check non-zero header IDs
vinay-deshmukh 6367439
Add va_start,va_arg,va_end to allow list
vinay-deshmukh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // RUN: %clang_cc1 -std=c89 -verify=c89 %s | ||
|
|
||
| // From: https://github.com/llvm/llvm-project/issues/15522#issue-1071059939 | ||
| int logf = 5; // this is fine | ||
|
|
||
| // redefinition because log as a symbol exists in C89 | ||
| int log = 6; // #1 | ||
| int main() { | ||
| return 0; | ||
| } | ||
|
|
||
| // c89-error@#1 {{redefinition of 'log' as different kind of symbol}} | ||
| // c89-note@#1 {{unguarded header; consider using #ifdef guards or #pragma once}} | ||
| // c89-note@#1 {{previous definition}} |
Oops, something went wrong.
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.
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.
The list would be very long, see https://port70.net/~nsz/c/c89/c89-draft.html. Perhaps we should add a
.deffile for this.