Skip to content

Commit c9d44a7

Browse files
committed
Silence "expression result unused" warnings in AssertVariableIsOfTypeMacro
At least clang 3.1 generates those warnings. Prepend (void) to avoid them, like we have in AssertMacro.
1 parent 42218f2 commit c9d44a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/include/c.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,15 +736,15 @@ typedef NameData *Name;
736736
StaticAssertStmt(__builtin_types_compatible_p(__typeof__(varname), typename), \
737737
CppAsString(varname) " does not have type " CppAsString(typename))
738738
#define AssertVariableIsOfTypeMacro(varname, typename) \
739-
StaticAssertExpr(__builtin_types_compatible_p(__typeof__(varname), typename), \
740-
CppAsString(varname) " does not have type " CppAsString(typename))
739+
((void) StaticAssertExpr(__builtin_types_compatible_p(__typeof__(varname), typename), \
740+
CppAsString(varname) " does not have type " CppAsString(typename)))
741741
#else /* !HAVE__BUILTIN_TYPES_COMPATIBLE_P */
742742
#define AssertVariableIsOfType(varname, typename) \
743743
StaticAssertStmt(sizeof(varname) == sizeof(typename), \
744744
CppAsString(varname) " does not have type " CppAsString(typename))
745745
#define AssertVariableIsOfTypeMacro(varname, typename) \
746-
StaticAssertExpr(sizeof(varname) == sizeof(typename), \
747-
CppAsString(varname) " does not have type " CppAsString(typename))
746+
((void) StaticAssertExpr(sizeof(varname) == sizeof(typename), \
747+
CppAsString(varname) " does not have type " CppAsString(typename)))
748748
#endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */
749749

750750

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy