mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 00:00:14 +01:00
logging: assert that NMLogDomains compiles to a 64 bit enum
Enum types larger then the native 'int' type are undefined behavior according to C standard. Assert that our compiler does the right thing. the expression that defines the value of an enumeration constant shall be an integer constant expression that has a value representable as an int
This commit is contained in:
parent
11b9562898
commit
670eb57321
1 changed files with 3 additions and 0 deletions
|
|
@ -104,6 +104,9 @@ static const LogDesc domain_descs[] = {
|
|||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* We have more then 32 logging domains. Assert that it compiles to a 64 bit sized enum */
|
||||
G_STATIC_ASSERT (sizeof (NMLogDomain) >= sizeof (guint64));
|
||||
|
||||
/* Combined domains */
|
||||
#define LOGD_ALL_STRING "ALL"
|
||||
#define LOGD_DEFAULT_STRING "DEFAULT"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue