Mark hash_corrupted() as pg_attribute_noreturn.
[pgsql.git] / src / tools / find_badmacros
blob58f43086e9a4e8ab037e9091daab8185bbe46d96
1 #!/bin/sh
3 # This script attempts to find bad ifdef's, i.e. ifdef's that use braces
4 # but not the do { ... } while (0) syntax
6 # src/tools/find_badmacros
8 # This is useful for running before pgindent
10 for FILE
12 awk ' BEGIN {was_define = "N"}
13 { if (was_define == "Y" &&
14 $0 ~ /^{/)
15 printf "%s %d\n", FILENAME, NR
16 if ($0 ~ /^#define/)
17 was_define = "Y"
18 else
19 was_define = "N"
20 }' "$FILE"
21 grep -on '^#define.*{' "$FILE" | grep -v 'do[ ]*{'
22 done