This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wmissing-attributes: avoid duplicates and false positives

On Jul 17, 2019, Martin Sebor <> wrote:

> Isn't this test sufficient to avoid the problems?

> 	      if (!k && kmax > 1)
> 		continue;

It is, unless someone (i) doesn't realize attributes that are present in
the type can't be present in the decl, (ii) misreads the '!k' as just
'k', and (iii) uses the wrong toolchain to confirm the consequences of
the misreading ;-/  doh!

> Can you put together a test case that does do the wrong thing?

I'm afraid not, all of the additional errors I observed were correctly
covered by the test I misunderstood once I grasped the actual logic.
Sorry about the, erhm, false positive ;-)

> The change looks cleaner than the cumbersome code that's there
> now so I have no problem with it but I'm not sure it does more
> than the test above

Would you like me to put it in regardless?
Does it make sense to put the testcase in anyway?

Alexandre Oliva, freedom fighter  he/him
Be the change, be Free!                 FSF Latin America board member
GNU Toolchain Engineer                        Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás - Che GNUevara

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]