This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Replace gdb_static_assert with static_assert
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Tue, 05 Dec 2017 11:32:19 -0500
- Subject: Re: [PATCH] Replace gdb_static_assert with static_assert
- Authentication-results: sourceware.org; auth=none
- References: <1512422710-26693-1-git-send-email-simon.marchi@ericsson.com> <86shcpp280.fsf@gmail.com>
On 2017-12-05 11:29, Yao Qi wrote:
Simon Marchi <simon.marchi@ericsson.com> writes:
gdb/ChangeLog:
* common/gdb_assert.h: Remove.
* common/gdb_assert.h (gdb_static_assert): Remove.
because you don't remove this file.
Woops, thanks.
-/* A static assertion. This will cause a compile-time error if EXPR,
- which must be a compile-time constant, is false. */
-
-#define gdb_static_assert(expr) \
- extern int never_defined_just_used_for_checking[(expr) ? 1 : -1]
Did you consider define gdb_static_assert as static_assert ((expr),
"")?
You don't have to change anywhere else. Additionally, one day we move
to c++17, we can replace gdb_static_assert with static_assert globally.
That's a good idea, I'll do that.
Thanks,
Simon