[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] include/essentials: Introduce __maybe_unused attribute



Introduce __maybe_unused attribute macro that should be used for cases
where the usage of a symbol depends on a configuration.

Code example:

 #include <uk/config.h>

 int myfunc(int myparam __maybe_unused)
 {
 #if CONFIG_USE_MYPARAM
     return (myparam * 48); /* myparam is used */
 #else
     return 0; /* myparam is not used but shall stay to keep API */
 #endif
 }

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
Signed-off-by: Dafna Hirschfeld <dafna3@xxxxxxxxx>
---
 include/uk/essentials.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uk/essentials.h b/include/uk/essentials.h
index f9a7fd1..3c16e30 100644
--- a/include/uk/essentials.h
+++ b/include/uk/essentials.h
@@ -55,6 +55,9 @@ extern "C" {
 #ifndef __used
 #define __used                 __attribute__((used))
 #endif
+#ifndef __maybe_unused
+#define __maybe_unused         __attribute__((unused))
+#endif
 #ifndef __unused
 #define __unused               __attribute__((unused))
 #endif
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.