Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 20, 2022 at 10:52:10AM -0700, Martin Sebor wrote: > On 1/20/22 10:03, Jakub Jelinek wrote: > > On Thu, Jan 20, 2022 at 09:56:59AM -0700, Martin Sebor wrote: > > > > With normal -Wformat I see all expected warnings in: > > > > char *foo (const char *) __attribute__((format_arg(1))); > >

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Martin Sebor via Gcc-patches
On 1/20/22 10:03, Jakub Jelinek wrote: On Thu, Jan 20, 2022 at 09:56:59AM -0700, Martin Sebor wrote: With normal -Wformat I see all expected warnings in: char *foo (const char *) __attribute__((format_arg(1))); void bar (const char *, ...) __attribute__((format(printf, 1, 2))); -Wformat-diag i

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 20, 2022 at 09:56:59AM -0700, Martin Sebor wrote: > > With normal -Wformat I see all expected warnings in: > > char *foo (const char *) __attribute__((format_arg(1))); > > void bar (const char *, ...) __attribute__((format(printf, 1, 2))); > > -Wformat-diag is internal to GCC and needs

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Martin Sebor via Gcc-patches
On 1/20/22 09:43, Jakub Jelinek wrote: On Thu, Jan 20, 2022 at 09:33:30AM -0700, Martin Sebor wrote: Oh, and one more thing, but this time not about this source file but about the warning. Does it handle the gettext case? I think -Wformat generally does, gettext has format_arg attribute. If the

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 20, 2022 at 09:33:30AM -0700, Martin Sebor wrote: > > Oh, and one more thing, but this time not about this source file but about > > the warning. Does it handle the gettext case? > > I think -Wformat generally does, gettext has format_arg attribute. > > If the warning handles > >pp

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Martin Sebor via Gcc-patches
On 1/20/22 03:28, Jakub Jelinek wrote: On Thu, Jan 20, 2022 at 11:17:28AM +0100, Jakub Jelinek via Gcc-patches wrote: --- a/gcc/cp/error.cc +++ b/gcc/cp/error.cc @@ -768,6 +768,11 @@ class_key_or_enum_as_string (tree t) return "struct"; } +#if __GNUC__ >= 10 +#pragma GCC diagnostic push

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 20, 2022 at 11:17:28AM +0100, Jakub Jelinek via Gcc-patches wrote: > > --- a/gcc/cp/error.cc > > +++ b/gcc/cp/error.cc > > @@ -768,6 +768,11 @@ class_key_or_enum_as_string (tree t) > > return "struct"; > > } > > +#if __GNUC__ >= 10 > > +#pragma GCC diagnostic push > > +#pragma GCC

Re: [PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 20, 2022 at 10:43:55AM +0100, Martin Liška wrote: > The patch disables "-Wformat-diag" for dump_aggr_type. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > PR c++/104134 > > gcc/cp/ChangeLog: > >

[PATCH] Fix Werror=format-diag with --disable-nls.

2022-01-20 Thread Martin Liška
The patch disables "-Wformat-diag" for dump_aggr_type. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR c++/104134 gcc/cp/ChangeLog: * error.cc (dump_aggr_type): Partially disable the warning. --- gcc/cp/error.cc