Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22240

GCC switches to enable analysis for warnings

$
0
0

In GCC, certain warnings require optimization to be enabled. For example:

int foo() {    int x;    return x;}

In order to detect the uninitialized variable, -O must be passed.

$ gcc -W -Wall -c test.c$ gcc -W -Wall -c test.c -O
test.c: In function ‘foo’:test.c:3: warning: ‘x’ is used uninitialized in this function

However, this can interfere with debugging. Is there a way to enable just the analysis phases needed for warnings (and not just this particular warning, but as many as possible), without affecting the generated code too much?

I'm using GCC version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) on x86-64.


Viewing all articles
Browse latest Browse all 22240

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>