Re: [PATCH v3 1/9] i386/pc/int.h: conditionally apply regparm attr.

"Vladimir 'phcoder' Serbinenko" <[email protected]> Sat, 14 Feb 2026 10:20:24 +0300
Newsgroups org.gnu.grub-devel
Message-ID <CAEaD8JMfj65F11tM4TfjM-RH_ZfrOQYQEBgneLpPqAqzELDNrw@mail.gmail.com>
--===============2643844021058580592==
Content-Type: multipart/alternative; boundary="000000000000d243ce064ac38ed9"

--000000000000d243ce064ac38ed9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Entire function is undefined on non-i386 and even there should only be
called on i386-pc. Please surround the entire function definition with
right ifdef rather than just the attribute.

Regards
Vladimir 'phcoder' Serbinenko

Le sam. 14 f=C3=A9vr. 2026, 04:07, Nicholas Vinson <[email protected]> a
=C3=A9crit :

> Modern compilers are becoming more strict and are starting to warn when
> certain attributs are ignored. The regparam attribute is such an
> attribute.
>
> Update the code so the regparam attribute is only appled when building
> against i386 targets as that is the only scenario when it is not
> ignored.
>
> Signed-off-by: Nicholas Vinson <[email protected]>
> ---
>  include/grub/i386/pc/int.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/grub/i386/pc/int.h b/include/grub/i386/pc/int.h
> index a60104001..4b569ca25 100644
> --- a/include/grub/i386/pc/int.h
> +++ b/include/grub/i386/pc/int.h
> @@ -24,7 +24,10 @@
>
>  void EXPORT_FUNC (grub_bios_interrupt) (grub_uint8_t intno,
>                                         struct grub_bios_int_registers
> *regs)
> -     __attribute__ ((regparm(3)));
> +#if defined(__i386__) && !defined(__x86_64__)
> +     __attribute__ ((regparm(3)))
> +#endif
> +;
>
>  #ifdef GRUB_MACHINE_PCBIOS
>  extern struct grub_i386_idt *EXPORT_VAR(grub_realidt);
> --
> 2.53.0
>
>
> _______________________________________________
> Grub-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

--000000000000d243ce064ac38ed9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>Entire function is undefined on non-i386 and even th=
ere should only be called on i386-pc. Please surround the entire function d=
efinition with right ifdef rather than just the attribute.</div><div><br></=
div><div data-smartmail=3D"gmail_signature">Regards<br>Vladimir &#39;phcode=
r&#39; Serbinenko<br></div></div><br><div class=3D"gmail_quote gmail_quote_=
container"><div dir=3D"ltr" class=3D"gmail_attr">Le sam. 14 f=C3=A9vr. 2026=
, 04:07, Nicholas Vinson &lt;<a href=3D"mailto:[email protected]">nvinso=
[email protected]</a>&gt; a =C3=A9crit=C2=A0:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex">Modern compilers are becoming more strict and are starting to warn =
when<br>
certain attributs are ignored. The regparam attribute is such an<br>
attribute.<br>
<br>
Update the code so the regparam attribute is only appled when building<br>
against i386 targets as that is the only scenario when it is not<br>
ignored.<br>
<br>
Signed-off-by: Nicholas Vinson &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank" rel=3D"noreferrer">[email protected]</a>&gt;<br>
---<br>
=C2=A0include/grub/i386/pc/int.h | 5 ++++-<br>
=C2=A01 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/include/grub/i386/pc/int.h b/include/grub/i386/pc/int.h<br>
index a60104001..4b569ca25 100644<br>
--- a/include/grub/i386/pc/int.h<br>
+++ b/include/grub/i386/pc/int.h<br>
@@ -24,7 +24,10 @@<br>
<br>
=C2=A0void EXPORT_FUNC (grub_bios_interrupt) (grub_uint8_t intno,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct g=
rub_bios_int_registers *regs)<br>
-=C2=A0 =C2=A0 =C2=A0__attribute__ ((regparm(3)));<br>
+#if defined(__i386__) &amp;&amp; !defined(__x86_64__)<br>
+=C2=A0 =C2=A0 =C2=A0__attribute__ ((regparm(3)))<br>
+#endif<br>
+;<br>
<br>
=C2=A0#ifdef GRUB_MACHINE_PCBIOS<br>
=C2=A0extern struct grub_i386_idt *EXPORT_VAR(grub_realidt);<br>
-- <br>
2.53.0<br>
<br>
<br>
_______________________________________________<br>
Grub-devel mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"noreferrer">=
[email protected]</a><br>
<a href=3D"https://lists.gnu.org/mailman/listinfo/grub-devel" rel=3D"norefe=
rrer noreferrer" target=3D"_blank">https://lists.gnu.org/mailman/listinfo/g=
rub-devel</a><br>
</blockquote></div>

--000000000000d243ce064ac38ed9--


--===============2643844021058580592==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR3J1Yi1kZXZl
bCBtYWlsaW5nIGxpc3QKR3J1Yi1kZXZlbEBnbnUub3JnCmh0dHBzOi8vbGlzdHMuZ251Lm9yZy9t
YWlsbWFuL2xpc3RpbmZvL2dydWItZGV2ZWwK

--===============2643844021058580592==--