Fix: BT_ASSERT_PRE_DEV(): use `##__VA_ARGS`, not `#__VA_ARGS`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 15 Jul 2019 21:10:17 +0000 (17:10 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 18 Jul 2019 13:42:13 +0000 (09:42 -0400)
`#__VA_ARGS` stringifies the arguments: that's bad.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ifa4c3494d3d082fd28aad72af726319f1578df2e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1713
Tested-by: jenkins <jenkins@lttng.org>
src/lib/assert-pre.h

index 17ee8a89ad74ac27c96d64155412a9c5e6972ad6..942851f21fb7b2684fdc7f5b3942447d1ae0fda2 100644 (file)
 
 #ifdef BT_DEV_MODE
 /* Developer mode version of BT_ASSERT_PRE_MSG(). */
-# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...)                                      \
-       BT_ASSERT_PRE_MSG(_fmt, #__VA_ARGS__)
+# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...)                              \
+       BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__)
 
 /* Developer mode version of BT_ASSERT_PRE(). */
 # define BT_ASSERT_PRE_DEV(_cond, _fmt, ...)                           \
-       BT_ASSERT_PRE((_cond), _fmt, #__VA_ARGS__)
+       BT_ASSERT_PRE((_cond), _fmt, ##__VA_ARGS__)
 
 /* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
 # define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name)                   \
This page took 0.025528 seconds and 4 git commands to generate.