Actions
Bug #13894
closedcompile time assertions need more uniqueness
Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:
0%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
At present, we do compile time assertions like this:
#define CTASSERT(x) _CTASSERT(x, __LINE__) #define _CTASSERT(x, y) __CTASSERT(x, y) #define __CTASSERT(x, y) \ typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1] __unused
Which appeared with the OpenZFS crypto checksum support.
Unfortunately, this means that only the source line is used to provide uniqueness. One cannot have two assertions at the same line number in the same compilation unit, which includes any headers.
Related issues
Updated by Rich Lowe over 2 years ago
- Is duplicate of Bug #12994: CTASSERT should not clash on same line num added
Updated by Patrick Mooney almost 2 years ago
- Related to Feature #14454: sys/debug.h: CTASSERT should use _Static_assert added
Actions