diff mbox series

[33/39] stdio: Suppress -Wformat only for gcc for tst-sprintf-errno.c

Message ID 20241222000509.2205895-34-hjl.tools@gmail.com
State New
Headers show
Series [01/39] conform: Use -dD instead of -dN on compiler invocation | expand

Commit Message

H.J. Lu Dec. 22, 2024, 12:04 a.m. UTC
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>

---
 stdio-common/tst-sprintf-errno.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sam James Dec. 22, 2024, 4:56 a.m. UTC | #1
"H.J. Lu" <hjl.tools@gmail.com> writes:

> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>

Is this because Clang supports %#m? (With a poor grep, I can't find it,
but I didn't check an example).

> ---
>  stdio-common/tst-sprintf-errno.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
> index e00c3fb485..2ea1fde2dc 100644
> --- a/stdio-common/tst-sprintf-errno.c
> +++ b/stdio-common/tst-sprintf-errno.c
> @@ -24,7 +24,7 @@
>  
>  /* GCC does not yet know about the %#m specifier.  */
>  DIAG_PUSH_NEEDS_COMMENT;
> -DIAG_IGNORE_NEEDS_COMMENT (11, "-Wformat=");
> +DIAG_IGNORE_NEEDS_COMMENT_GCC (11, "-Wformat=");
>  
>  static int
>  do_test (void)

If so,

Reviewed-by: Sam James <sam@gentoo.org>
H.J. Lu Dec. 22, 2024, 10:32 a.m. UTC | #2
On Sun, Dec 22, 2024 at 12:56 PM Sam James <sam@gentoo.org> wrote:
>
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
> > From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> >
>
> Is this because Clang supports %#m? (With a poor grep, I can't find it,
> but I didn't check an example).

I don't know.  But clang doesn't complain about %m.

>
> > ---
> >  stdio-common/tst-sprintf-errno.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
> > index e00c3fb485..2ea1fde2dc 100644
> > --- a/stdio-common/tst-sprintf-errno.c
> > +++ b/stdio-common/tst-sprintf-errno.c
> > @@ -24,7 +24,7 @@
> >
> >  /* GCC does not yet know about the %#m specifier.  */
> >  DIAG_PUSH_NEEDS_COMMENT;
> > -DIAG_IGNORE_NEEDS_COMMENT (11, "-Wformat=");
> > +DIAG_IGNORE_NEEDS_COMMENT_GCC (11, "-Wformat=");
> >
> >  static int
> >  do_test (void)
>
> If so,
>
> Reviewed-by: Sam James <sam@gentoo.org>
>
diff mbox series

Patch

diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
index e00c3fb485..2ea1fde2dc 100644
--- a/stdio-common/tst-sprintf-errno.c
+++ b/stdio-common/tst-sprintf-errno.c
@@ -24,7 +24,7 @@ 
 
 /* GCC does not yet know about the %#m specifier.  */
 DIAG_PUSH_NEEDS_COMMENT;
-DIAG_IGNORE_NEEDS_COMMENT (11, "-Wformat=");
+DIAG_IGNORE_NEEDS_COMMENT_GCC (11, "-Wformat=");
 
 static int
 do_test (void)