On Tue, Oct 7, 2025, 16:25 Jerry D <[email protected]> wrote:

> On 10/7/25 1:13 PM, Harald Anlauf wrote:
> > Dear All,
> >
> > the attached patch addresses a rather old (> 14 years) issue.
> > We generated warnings for standard conforming code, where a symbol
> > was given a bind(c) attribute and at the same time declared PRIVATE.
> >
> > I checked a bunch of compilers, and none gave warnings, except for
> > NAG, which did warn, but only if the binding name were the same as
> > the default name.
> >
> > I considered this to be a good solution, and decided to "hide" the
> > warning behind -Wsurprising (contained in -Wall).
> >
> > What do others think?
> >
> > Attached has been regtested on x86_64-pc-linux-gnu.  OK for mainline?
> >
> > Thanks,
> > Harald
> >
>
> I think your approach is very reasonable. It gets rid of noise that users
> do not
> need, very OK by me.
>
> Jerry
>

I don't think it gets rid of noise if it moves the warning to Wall. In
fact, comment 3 in the bug report describes my exact use case, which should
never warn, and requiring zero warnings at Wall is a common and encouraged
project goal.

This warning should either be smarter to disambiguate intended and good
uses or moved to its own option that is not part of Wall or Wextra.

>

Reply via email to