Skip to content

Sanitize header guard names for generated output files - #99

Merged
lwJi merged 1 commit into
mainfrom
codex/find-and-fix-easy-issue-in-codebase
Jan 15, 2026
Merged

Sanitize header guard names for generated output files#99
lwJi merged 1 commit into
mainfrom
codex/find-and-fix-easy-issue-in-codebase

Conversation

@lwJi

@lwJi lwJi commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent invalid C preprocessor macro names when generating header guards from output filenames by normalizing non-alphanumeric characters.

Description

  • Updated WriteToFile in src/Writefile.wl to compute a headerGuard by uppercasing FileNameTake[outputfile] and replacing any non-letter/digit characters with underscores, and used headerGuard for the emitted #ifndef, #define, and #endif lines.

Testing

  • No automated tests were run.

Codex Task

@lwJi
lwJi merged commit 34d7361 into main Jan 15, 2026
1 check passed
@lwJi
lwJi deleted the codex/find-and-fix-easy-issue-in-codebase branch January 15, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant