[waffle] [PATCH 1/6] examples/gl_basic: Mark error functions as noreturn

Jeff Bland jksb at linux.com
Sun Mar 3 03:07:24 PST 2013


This avoids a clang static analyzer warning about use of freed memory.
---
 examples/gl_basic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/gl_basic.c b/examples/gl_basic.c
index c3abc2f..43dabf8 100644
--- a/examples/gl_basic.c
+++ b/examples/gl_basic.c
@@ -73,7 +73,7 @@ static const char *usage_message =
 /// All error handlers exit.
 ///
 
-static void
+static void __attribute__((noreturn))
 gl_basic_error(const char *fmt, ...)
 {
     va_list ap;
@@ -88,7 +88,7 @@ gl_basic_error(const char *fmt, ...)
 
     exit(EXIT_FAILURE);
 }
-static void
+static void __attribute__((noreturn))
 error_usage(void)
 {
     fprintf(stderr, "usage error\n\n");
-- 
1.7.12.4 (Apple Git-37)



More information about the waffle mailing list