Skip to content
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

Check empty strings on macro expansion #4

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Feb 15, 2025

During macro expansion, bare macros on a line are accepted by the parser as long as they resolve to blank strings. The problem is that the script is currently checking using isspace, so it's actually not checking for blank strings.

This causes the parsing to fail when a macro is the last line of a file, and no newline character is added afterwards. This patch adds a check for the string itself being empty.

During macro expansion, bare macros on a line are accepted by the parser
as long as they resolve to blank strings. The problem is that the script
is currently checking using isspace, so it's actually not checking for
blank strings.

This causes the parsing to fail when a macro is the last line of a file,
and no newline character is added afterwards. This patch adds a check for
the string itself being empty.

Signed-off-by: Jim Huang <[email protected]>
@jserv jserv merged commit 3dd1b46 into main Feb 15, 2025
3 checks passed
@jserv jserv deleted the fix_preprocessor_expanded_empty branch February 15, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants