Warnings not showing in "Issues" or "Compile Output"
-
In Qt Creator I am trying to find dead code in my app by using the following in my "pro" file:
QMAKE_CXXFLAGS += -std=c++11\ -O3\ -Wunused\ -Wunreachable-code
As a test, just to make sure there is some dead code, I added this function to my code:
int none() { return -1; }
But no such message shows up in the "Issues" or "Compile Output" window.
-
In Qt Creator I am trying to find dead code in my app by using the following in my "pro" file:
QMAKE_CXXFLAGS += -std=c++11\ -O3\ -Wunused\ -Wunreachable-code
As a test, just to make sure there is some dead code, I added this function to my code:
int none() { return -1; }
But no such message shows up in the "Issues" or "Compile Output" window.
@Guerrian said in Warnings not showing in "Issues" or "Compile Output":
But no such message shows up in the "Issues" or "Compile Output" window.
Try:
int none() { return -1; int z = 0; }
and tell us if that changes.
-
@Guerrian said in Warnings not showing in "Issues" or "Compile Output":
I was expecting it to tell me about unused functions.
Nope. Unused functions are not "unreachable code".
You can still call them. ;) -
@Guerrian said in Warnings not showing in "Issues" or "Compile Output":
-Wunused
This finds unused variables.
-Wunreachable-code
This finds things like @kshegunov's example.
@Guerrian said in Warnings not showing in "Issues" or "Compile Output":
I was expecting it to tell me about unused functions.
You need a static code analyzer.