[coreboot-gerrit] Change in coreboot[master]: add __must_check to */compiler.h

Caveh Jalali (Code Review) gerrit at coreboot.org
Sat Aug 5 00:33:11 CEST 2017


Caveh Jalali has uploaded this change for review. ( https://review.coreboot.org/20881


Change subject: add __must_check to */compiler.h
......................................................................

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 at google.com>
---
M payloads/libpayload/include/compiler.h
M src/include/compiler.h
M util/cbfstool/compiler.h
M util/cbmem/compiler.h
4 files changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/20881/1

diff --git a/payloads/libpayload/include/compiler.h b/payloads/libpayload/include/compiler.h
index f218725..a830239 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 f218725..a830239 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 f218725..a830239 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 f218725..a830239 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

-- 
To view, visit https://review.coreboot.org/20881
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1812d957b745d6bebe2a8d34a9c4862316aa8530
Gerrit-Change-Number: 20881
Gerrit-PatchSet: 1
Gerrit-Owner: Caveh Jalali <caveh at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170804/99d41e3f/attachment.html>


More information about the coreboot-gerrit mailing list