Top "Gcc-warning" questions

GCC is the GNU Compiler Collection, encompassing the gcc C compiler and the g++ C++ compiler, among others.

Why does a "function name" evaluate to true in C and how to get warned on it

I recently stumbled across the following behaviour of gcc 3.2.2 writing a c program: In an if statement I forgot the …

c gcc-warning
GCC warning: ISO C does not permit named variadic macros

Using the following command gcc -c -Wall -Wextra -pedantic -ansi -std=c99 -fstack-protector-all -fstack-check -O3 root.c -o rootTESTOBJECT I …

gcc gcc-warning
Tell gcc that a function call will not return

I am using C99 under GCC. I have a function declared static inline in a header that I cannot modify. …

c gcc gcc-warning noreturn
MSVC equivalent of __attribute__ ((warn_unused_result))?

I'm finding __attribute__ ((warn_unused_result)) to be very useful as a means of encouraging developers not to ignore error …

c++ c visual-c++ gcc gcc-warning
How to eliminate external lib/third party warnings in GCC

In the software project I'm working on, we use certain 3rd party libraries which, sadly, produce annoying gcc warnings. We …

c++ gcc include suppress-warnings gcc-warning
Compile and run program without main() in C

I'm trying to compile and run following program without main() function in C. I have compiled my program using the …

c gcc segmentation-fault main gcc-warning
How to make gcc warn about passing wrong enum to a function

gcc doesn't seem to produce a warning with the following code. How can I get it to produce a warning? …

gcc enums gcc-warning
How to wrap functions with the `--wrap` option correctly?

The man page of gcc 6.3 says: --wrap=symbol Use a wrapper function for symbol. Any undefined reference to symbol will …

c++ c gcc gcc-warning linker-flags
How to do an explicit fall-through in C

The newer versions of gcc offer the Wimplicit-fallthrough, which is great to have for most switch statements. However, I have …

c gcc c99 gcc-warning
Why does -Wcast-align not warn about cast from char* to int* on x86?

I understand that gcc has an option -Wcast-align which warns whenever a pointer is cast such that the required alignment …

c memory-alignment gcc-warning typecasting-operator