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

Disabling the "did you mean..." suggestions in GCC

$
0
0

Newer versions of GCC come with what I consider to be an irritating misfeature: they try to second-guess me, emitting useless "did you mean?" suggestions that drown out other warnings.

For example:

$ gcc -Wall -c -o /dev/null -xc - <<'EOT'
#include <stdlib.h>

void foo(char *b, size_t z){ readlink("/foo", b, z); }
EOT
<stdin>: In function ‘foo’:
<stdin>:3:30: warning: implicit declaration of function ‘readlink’;
did you mean ‘realloc’? [-Wimplicit-function-declaration]

No, I did not mean realloc; I just forgot to include the unistd.h header.

Is there any way to turn this off?

I want to have it print just implicit declaration of function ‘readlink’ [-Wimplicit-function-declaration], without the helpful suggestion.


Viewing all articles
Browse latest Browse all 22037

Trending Articles



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