mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
core: drop unnecessary __useless_struct_to_allow_trailing_semicolon__
ISO C does not allow empty statements outside of functions, and gcc will warn the trailing semicolons when compiling with -pedantic: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic] But our code cannot compile with -pedantic anyway, at least because warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic] Without -pedatnic, clang and even old gcc (3.4) generate no warnings about those semicolons, so let's just drop __useless_struct_to_allow_trailing_semicolon__.
This commit is contained in:
@@ -93,13 +93,11 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope)
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope) \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope)
|
||||
|
||||
#define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,static)
|
||||
@@ -111,8 +109,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
||||
/* For string conversions where numbers are also acceptable */
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max,) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,) \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,)
|
||||
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max,static)
|
||||
|
||||
Reference in New Issue
Block a user