diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-06-12 15:02:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-06-13 09:48:45 +0200 |
commit | 1b8a96544828597062daa514059a33ad41826136 (patch) | |
tree | acd5cb53f78267fa5c1e007403585a4057226a07 /commands | |
parent | f8b3311dd2309a815613341b84df32cc176aedc2 (diff) | |
download | barebox-1b8a96544828597062daa514059a33ad41826136.tar.gz barebox-1b8a96544828597062daa514059a33ad41826136.tar.xz |
commands: ubsan: hide pointer provenance used to trigger UB
The ubsan command invokes various sort of undefined behavior to verify
that the Undefined Behavior Sanitizer works as expected. Compiler warns
about some of this, which is not helpful, so work around the warning.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230612130239.1087599-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/ubsan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/ubsan.c b/commands/ubsan.c index 620b4774c3..4a9716139c 100644 --- a/commands/ubsan.c +++ b/commands/ubsan.c @@ -102,6 +102,8 @@ static void test_ubsan_object_size_mismatch(void) volatile long long *ptr, val2; ptr = (long long *)&val; + OPTIMIZER_HIDE_VAR(ptr); + val2 = *ptr; } |