Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kugelfuhr
Copy link
Contributor

This PR fixes both issues from #2515.

I would have also added a test which was already written, but there seems to be no simple way to execute it in a way that works with the current test infrastructure.

@mrdudz
Copy link
Contributor

mrdudz commented Sep 13, 2024

Thanks!

would you post the test anyway? I'll try adding it in misc then

@mrdudz mrdudz merged commit 7260c10 into cc65:master Sep 13, 2024
2 checks passed
@kugelfuhr
Copy link
Contributor Author

This test file

#line 13"x"
#define X"y"
int main() { foo; }

generates

test.c:1: Error: #line directive requires a simple decimal digit sequence
test.c:3: Error: Undeclared identifier 'foo'
2 errors and 0 warnings generated.

before the fix. After the fix, the output depends on the --standard setting. With no standard or --standard c89 it generates

x:14: Error: Undeclared identifier 'foo'
1 errors and 0 warnings generated.

while it says

x:13: Warning: ISO C99 requires whitespace after the macro name
x:14: Error: Undeclared identifier 'foo'
1 errors and 1 warnings generated.

using --standard c99.

@mrdudz
Copy link
Contributor

mrdudz commented Sep 14, 2024

Oh this is a tricky one :)

@mrdudz
Copy link
Contributor

mrdudz commented Sep 15, 2024

added the test in 7dc09fd

@kugelfuhr kugelfuhr deleted the kugelfuhr/fix-2515 branch June 12, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants