Skip to content

Commit 0cd0d9e

Browse files
committed
lib: rename BUILD_BUG_ON macro
It can collide with existing macros of same name: gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -Illtp -o quotactl03 In file included from ../../../../include/tst_test.h:29:0, from quotactl03.c:53: ../../../../include/tst_common.h:68:0: warning: "BUILD_BUG_ON" redefined #define BUILD_BUG_ON(condition) \ In file included from /usr/include/xfs/xqm.h:21:0, from quotactl03.c:50: /usr/include/xfs/xfs.h:68:0: note: this is the location of the previous definiti #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) Suggested-by: Cyril Hrubis <[email protected]> Signed-off-by: Jan Stancek <[email protected]>
1 parent 41fae34 commit 0cd0d9e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/tst_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
ERET; \
6666
})
6767

68-
#define BUILD_BUG_ON(condition) \
68+
#define TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition) \
6969
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)
7070

7171
#endif /* TST_COMMON_H__ */

include/tst_test.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ void tst_brk_(const char *file, const int lineno, int ttype,
7171

7272
#define tst_brk(ttype, arg_fmt, ...) \
7373
({ \
74-
BUILD_BUG_ON(!((ttype) & (TBROK | TCONF | TFAIL))); \
74+
TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(!((ttype) & \
75+
(TBROK | TCONF | TFAIL))); \
7576
tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
7677
})
7778

0 commit comments

Comments
 (0)