mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! commands: ubsan: hide zero division in test
Date: Wed, 19 Mar 2025 17:10:56 +0100	[thread overview]
Message-ID: <20250319161056.2086121-1-a.fatoum@pengutronix.de> (raw)

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




                 reply	other threads:[~2025-03-19 16:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319161056.2086121-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox