Created
September 10, 2025 23:02
-
-
Save aaronpuchert/4ee3be792b692c78f0a3e28db398f130 to your computer and use it in GitHub Desktop.
Rudimentary script to find unbalanced warning pragmas in preprocessed source
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
| #!/bin/bash | |
| grep -n -E "#pragma $1 diagnostic (push|pop)" $2 | \ | |
| awk "BEGIN { FS = \":\" } | |
| \$2 == \"#pragma $1 diagnostic push\" { ++level; print \$1, level} | |
| \$2 == \"#pragma $1 diagnostic pop\" { --level; print \$1, level}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment