summaryrefslogtreecommitdiff
path: root/src/check-headers.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-04-08 20:50:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-04-09 15:01:58 +0100
commit46eab95698e101e41407778eda22089b508a8984 (patch)
treebf0f4d0587d1afa8f8aa41dce276557a1d93fbd5 /src/check-headers.sh
parent9da86e4a386505288c3a933f30583abf7706c950 (diff)
Add attribute(warn_unused_result)
This adds a compiler check that the function result is used by the caller and enables it by default for all cairo_private functions and for public API that returns a cairo_status_t. It has been discussed that to extend the warnings to all functions, a new function type could been introduced to cover static functions: cairo_static. This has not been done at the present time in order to minimise the churn and focus on the more common errors. In order to reduce the warning spew generated by gcc for invalid use of this attribute, -Wno-attributes is added to CFLAGS. This has the unfortunate side-effect of masking future warnings for all attributes - be warned!
Diffstat (limited to 'src/check-headers.sh')
-rwxr-xr-xsrc/check-headers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check-headers.sh b/src/check-headers.sh
index 1d0ebf816..2ac74fd21 100755
--- a/src/check-headers.sh
+++ b/src/check-headers.sh
@@ -12,7 +12,7 @@ xargs grep -B 1 '^cairo_.*[ ]\+(' |
awk '
/^--$/ { context=""; public=0; next; }
/:cairo_.*[ ]+\(/ { if (!public) {print context; print; print "--";} next; }
-/-cairo_public[ ]/ {public=1;}
+/-cairo_public.*[ ]/ {public=1;}
{ context=$0; }
' |
sed 's/[.]h-/.h:/' |