mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! commands: ubsan: hide zero division in test
@ 2025-03-19 16:10 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-03-19 16:10 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

GCC complains that we pass the address of the variable instead of the
    variable itself:

    commands/ubsan.c: In function ‘test_ubsan_divrem_overflow’:
    error: lvalue required in ‘asm’ statement

       63 |         __asm__ ("" : "=r" (var) : "0" (var))
          |         ^~~~~~~
    ./commands/ubsan.c:46:9: note: in expansion of macro ‘OPTIMIZER_HIDE_VAR’
       46 |         OPTIMIZER_HIDE_VAR(&val2);

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/ubsan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/ubsan.c b/commands/ubsan.c
index 634ab2bc60b2..debd5e2ce7de 100644
--- a/commands/ubsan.c
+++ b/commands/ubsan.c
@@ -43,7 +43,7 @@ static void test_ubsan_divrem_overflow(void)
 	volatile int val = 16;
 	volatile int val2 = 0;
 
-	OPTIMIZER_HIDE_VAR(&val2);
+	OPTIMIZER_HIDE_VAR(val2);
 
 	val /= val2;
 }
-- 
2.39.5




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-19 16:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-19 16:10 [PATCH] fixup! commands: ubsan: hide zero division in test Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox