lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Unwanted "help" from gcc


From: Vadim Zeitlin
Subject: Re: [lmi] Unwanted "help" from gcc
Date: Mon, 7 Sep 2020 18:54:23 +0200

On Mon, 7 Sep 2020 15:15:36 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> On 2020-08-25 15:47, Vadim Zeitlin wrote:
GC> > 
GC> >  While working on trying to make wx headers compile at maximum warning
GC> 
GC> Since you're deep into this, let me ask whether you know of an
GC> option to turn off unwanted suggestions--here, for example:
GC> 
GC> /opt/lmi/src/lmi/ledger_invariant_init.cpp:107:69: error: ‘const class 
std::vector<currency>’ has no member named ‘operator double’; did you mean 
‘__ct_comp ’?
GC>          TermSpecAmt            = b->DeathBfts_->supplamt().operator 
double();
GC>                                                                      ^~~~~~
GC>                                                                      
__ct_comp
GC> 
GC> where I certainly did not mean some double-underscore prefixed name
GC> in the implementation's reserved namespace. I haven't seen gcc ever
GC> correctly guess what I meant. I want it to stop trying. Its bad
GC> guesses just confuse me.

 FWIW I did see a couple of reasonable guesses, but it's true that in my
experience they're useless at least 50% of the time, and maybe more often.
Unfortunately I'm pretty sure there is no way to turn them off, looking at
gcc sources, this particular warning comes from gcc/c/c-typeck.c which
calls lookup_field_fuzzy() unconditionally (well, if lookup_field() itself
failed, of course, so I guess one way of disabling the suggestions would be
to just not make any errors) which doesn't have any checks for any options
that might disable it inside it neither.

 So I can only confirm the answers given to this question:

https://stackoverflow.com/questions/58735374/disabling-the-did-you-mean-suggestions-in-gcc

(which I've actually found after looking at gcc sources), i.e. right now
there is no way to turn them off. As discussed at the URL above, piping gcc
through sed is possible, but not trivial, as these errors appear on
multiple lines, so I don't really have any good suggestions right now.

 There is also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82967 which
seems to have resulted in at least making gcc suggestions less zealous. But
AFAICS this is already included in gcc 9.1 and I believe you're using this,
or even a newer, version already. If this is indeed correct, I think it
would be worth updating the bug 82967 with the example above, as it clearly
still isn't as discriminating as it should be.

 Sorry, but, short of compiling your own gcc (and/or submitting a patch to
disable this to the upstream and see if it gets merged), there is nothing
else I can think of.

VZ

Attachment: pgp3kbjzN9yRj.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]