Ho to disable/make disappear error underlines in QtCreator ?
-
Hi all,
I'm using the following C macro in QtCreator:
#define Nil ((Object){ TT_NIL, { .n=0 } })
which causes this underlines to appear:
and in code (the comment show the messages I get by hovering on the underline with the mouse) :
Upvalue* new_upvalue(Object* value) { Upvalue* u = (Upvalue*)new_obj(sizeof(Upvalue), TT_UPVALUE); u->value = value; u->closed_value = Nil;// extra ; u->next = NULL; // expected a declaration return u; // expected token ';' got '{' }
I checked in the color table (tool->options->textEditor) but I didn't find a corresponding property to make those line transparent (or white, at least). I'm running Qt Creator 3.5.1 Based on Qt 5.5.1 (GCC 5.2.1 20151129, 64 bit) on Ubuntu 16:04.
Do you have any advice, please ?
Thanks -
-
Hi
When you provide pictures only, its very hard to check out what is going on
since you cant just copy the code. :(In any case for that old QtCreator, i think you can do
Tools -> Options -> Text Editor -> Font&Colors: find and check the "Error" at the "Color Scheme". Click "Copy", "Ok". Select No underline at the Underline section.
To make all such "bad code" underlines not showing.
But as @JonB says
would be good idea to check what its unhappy about.
(if it does show a hover tip) -
@mrjj Hi mrjj, I added the code together with the message I get by hovering on the underlines with the mouse. As I mentioned in my question, I tried to find a property in the Font&Colors list, but there's none referring to the Underline. Probably it was added in a later version. As regard the error itself, I don't think it makes any sense. Take this line:
u->closed_value = Nil;//extra ;
why would it ask for an extra ';' ? The other error messages are without any doubt a consequence of this syntax error, so of very little concern.
Thanks for your interest. -
@RobDaNet
Hi
The #define does not contain the ;
so when expanded it does miss the ;
and hence
value = Nil
does need the ;Note:
did you update the original post ?
We have some issues regarding refreshing after forum updates so hence i ask if you added new info:) -
Hi
Ah, yes if you use it as a parameter and not just for an assignment
then the ; cannot be included.but then you must add it when assigning. so in that context
u->closed_value = Nil;//extra ;
the ; is not really extra. (IMHO)Are you saying that with a c compiler it will accept
the define with no ;
at a assignment?
xxx = Nil -
hi
well if you include the "extra" ; then
i agree it should not whine.
However, in that old creator, im not sure that can be disabled.and just so i understand.
even with the ;
you get
u->next = NULL; // expected a declaration
return u; // expected token ';' got '{'?
-
Hi
Just as a note:
You can use QtCreator with any version of Qt.
So if you wish you could use the newest Creator with Qt5.5.1
Its only if you wish to make Creator plugins the version does matter.That said, im still not sure why it underlines it as
checking with other macros it seems to accept it. -
@mrjj Thanks for your note, too. I'm sure I will get the last version very soon. Especially since it offer the option to turn off the error underlining system. Maybe on the newest version these kind of macros won't even be flagged as an error, as you noticed before.