mirror of
https://github.com/dgibson/dtc.git
synced 2026-07-10 13:29:48 -04:00
tests: Avoid -Wconstant-logical-operand warnings in integer-expressions.c
Our examples trip this warning new in gcc 17, but we still want them. Reported-by: Ahmad Fatoum Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
a74b952f94
commit
d245851f06
1 changed files with 9 additions and 0 deletions
|
|
@ -17,6 +17,14 @@
|
|||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
|
||||
/*
|
||||
* Some of these trip the -Wconstant-logical-operand warning introduced in gcc
|
||||
* 17. Disable it temporarily, we also have to disable -Wpragmas for the
|
||||
* benefit of older compiler versions that don't know about that warning.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wconstant-logical-operand"
|
||||
static struct test_expr {
|
||||
const char *expr;
|
||||
uint32_t result;
|
||||
|
|
@ -51,6 +59,7 @@ static struct test_expr {
|
|||
TE(11 * 257 * 1321517ULL),
|
||||
TE(123456790 - 4/2 + 17%4),
|
||||
};
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue