summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@google.com>2017-08-03 15:49:09 -0700
committerMartin Roth <martinroth@google.com>2017-08-08 18:18:03 +0000
commit0068a9f57910b766cd534f83b8fcb0fee06bde60 (patch)
tree8b9a4eab97da596c840d42218e325362f0358a3a
parent93cdc8bbc20539cb9a2c1cbe3057c566cc5293e7 (diff)
add __must_check to */compiler.h
the __must_check function attribute is pretty much straight from the linux kernel - used to encourage callers to consume function return values. Change-Id: I1812d957b745d6bebe2a8d34a9c4862316aa8530 Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://review.coreboot.org/20881 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--payloads/libpayload/include/compiler.h1
-rw-r--r--src/include/compiler.h1
-rw-r--r--util/cbfstool/compiler.h1
-rw-r--r--util/cbmem/compiler.h1
4 files changed, 4 insertions, 0 deletions
diff --git a/payloads/libpayload/include/compiler.h b/payloads/libpayload/include/compiler.h
index f218725086..a830239009 100644
--- a/payloads/libpayload/include/compiler.h
+++ b/payloads/libpayload/include/compiler.h
@@ -24,5 +24,6 @@
#define __aligned(x) __attribute__((aligned(x)))
#define __always_unused __attribute__((unused))
+#define __must_check __attribute__((warn_unused_result))
#endif
diff --git a/src/include/compiler.h b/src/include/compiler.h
index f218725086..a830239009 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -24,5 +24,6 @@
#define __aligned(x) __attribute__((aligned(x)))
#define __always_unused __attribute__((unused))
+#define __must_check __attribute__((warn_unused_result))
#endif
diff --git a/util/cbfstool/compiler.h b/util/cbfstool/compiler.h
index f218725086..a830239009 100644
--- a/util/cbfstool/compiler.h
+++ b/util/cbfstool/compiler.h
@@ -24,5 +24,6 @@
#define __aligned(x) __attribute__((aligned(x)))
#define __always_unused __attribute__((unused))
+#define __must_check __attribute__((warn_unused_result))
#endif
diff --git a/util/cbmem/compiler.h b/util/cbmem/compiler.h
index f218725086..a830239009 100644
--- a/util/cbmem/compiler.h
+++ b/util/cbmem/compiler.h
@@ -24,5 +24,6 @@
#define __aligned(x) __attribute__((aligned(x)))
#define __always_unused __attribute__((unused))
+#define __must_check __attribute__((warn_unused_result))
#endif