Explorar el Código

misc/debug.h: add B_USE for suppressing warnings about uninitialized variables

ambrop7 hace 13 años
padre
commit
e0876b0af6
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      misc/debug.h

+ 10 - 0
misc/debug.h

@@ -78,6 +78,14 @@
  * Insert at the end of the declaration of a function before the semicolon.
  */
 
+/**
+ * @def B_USE
+ * 
+ * This can be used to suppress warnings about unused variables. It can
+ * be applied to a variable or any expression. It does not evaluate the
+ * expression.
+ */
+
 #ifndef BADVPN_MISC_DEBUG_H
 #define BADVPN_MISC_DEBUG_H
 
@@ -127,4 +135,6 @@
     #define WARN_UNUSED
 #endif
 
+#define B_USE(expr) (void)(sizeof((expr)));
+
 #endif