Qt Creator, syntax checking do not recognize gcc extensions.
-
Is there any way to turn off or add special case to Qt Creator syntax checking? I ask because now when I use for example gcc "Case Ranges" extension like
switch( size ) { case 1: // do x break; case 2 ... 255: // do y break; case 256 ... 512: // do z break; }
Qt Creator 4.1.1 show red underline warning which disturb reading code.
-
Is there any way to turn off or add special case to Qt Creator syntax checking? I ask because now when I use for example gcc "Case Ranges" extension like
switch( size ) { case 1: // do x break; case 2 ... 255: // do y break; case 256 ... 512: // do z break; }
Qt Creator 4.1.1 show red underline warning which disturb reading code.
I don't think you can fix the underline in creator, no. Why not use a simple if-else and not rely on non-standard extensions?
if (size == 1) // do x else if (size >= 2 && size <= 255) // do y // ... and so on
-
Hi
I support @kshegunov recommendation to not use those extensions.
However, there is the following feature
(Tools->Options menu)
You can change how the error underlining should look and hence also remove it.
Simply COPY the color theme and u can alter it.However this applies to all cases so not optimal but its still marked in the side so
you are not killing the feature completely. -
I don't think you can fix the underline in creator, no. Why not use a simple if-else and not rely on non-standard extensions?
if (size == 1) // do x else if (size >= 2 && size <= 255) // do y // ... and so on
Because as far as I know, switch can be sometimes better optimized by compiler and for me switch is more readable but it is a matter of taste.
I also think that this extension should be in standard, but that is another matter.
I report this behavior of Qt Creator to Qt Team as suggestion maybe it something will change...Thanks all,
-
Because as far as I know, switch can be sometimes better optimized by compiler and for me switch is more readable but it is a matter of taste.
I also think that this extension should be in standard, but that is another matter.
I report this behavior of Qt Creator to Qt Team as suggestion maybe it something will change...Thanks all,
@xtech said in Qt Creator, syntax checking do not recognize gcc extensions.:
Because as far as I know, switch can be sometimes better optimized by compiler
Not in this particular case.