diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-06 23:59:11 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-08 01:48:24 +0200 |
| commit | bbeebf636d496c9d5f7a270cb00465dabe87cae5 (patch) | |
| tree | 7281677cafbd9aee847c1d18cb318b4d270f7683 /validation | |
| parent | c9676a3b0349a1053c673243af52a2ef1b272bd7 (diff) | |
| download | sparse-dev-bbeebf636d496c9d5f7a270cb00465dabe87cae5.tar.gz | |
c2x: message in _Static_assert() is now optional
It seems that in the next version of the standard, the
second argument of _Static_assert() will be optional.
Nice. Let sparse already support this now.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/static_assert.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/validation/static_assert.c b/validation/static_assert.c index dd5e0c08..0ab5844e 100644 --- a/validation/static_assert.c +++ b/validation/static_assert.c @@ -53,6 +53,10 @@ _Static_assert(1, ); _Static_assert(, ""); _Static_assert(,); +// C2x's version: without message +_Static_assert(1); +_Static_assert(0); + /* * check-name: static assertion * @@ -67,5 +71,6 @@ static_assert.c:52:19: error: string literal expected for _Static_assert() static_assert.c:53:16: error: Expected constant expression static_assert.c:54:16: error: Expected constant expression static_assert.c:54:17: error: string literal expected for _Static_assert() +static_assert.c:58:16: error: static assertion failed * check-error-end */ |
