[gimp] configure: add warning for forgotten return value on non-void functions.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] configure: add warning for forgotten return value on non-void functions.
- Date: Tue, 8 Sep 2015 23:16:01 +0000 (UTC)
commit d62615293d3f7b38c98593a64b78872497d943ac
Author: Jehan <jehan girinstud io>
Date: Wed Sep 9 01:11:32 2015 +0200
configure: add warning for forgotten return value on non-void functions.
Adding -Wreturn-type for general case, but also -Wsystem-headers to warn
of g_return_if_fail() on non-void, since these are macros from system
headers directory, and -Wreturn-type would not warn for these.
configure.ac | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e2335c6..3ed4e05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -434,6 +434,14 @@ CFLAGS="$CFLAGS $extra_warnings"
GIMP_DETECT_CFLAGS(extra_warnings, '-fdiagnostics-show-option')
CFLAGS="$CFLAGS $extra_warnings"
+GIMP_DETECT_CFLAGS(extra_warnings, '-Wreturn-type')
+CFLAGS="$CFLAGS $extra_warnings"
+
+# -Wreturn-type warns on forgotten return on non-void functions,
+# but not of g_return_if_fail() on non-void functions.
+# -Wsystem-headers is needed for that.
+GIMP_DETECT_CFLAGS(extra_warnings, '-Wsystem-headers')
+CFLAGS="$CFLAGS $extra_warnings"
# Extra optimization flags for super performance
GIMP_DETECT_CFLAGS(extra_warnings, '--omg-optimized')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]