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

GCC force warning to be an error: excess elements in array initializer

$
0
0

My projects have to compile with two different compilers. One that creates a DLL (for a PC simulation, Mingw32-gcc-4.7.2) and another one that creates an ELF (for real hardware). Both compilers have partially different behaviors, but we want them to be as similar as possible, at least when it comes to errors.There is one particular error, that I want to activate in GCC, which is only a warning there:

warning: excess elements in array initializer [enabled by default]

Is there a way to only promote this warning to an error? I only found solutions to activate a group of warnings, but not just this one. And if I am not mistaken the group flag should be behind the warning message in brackets: [enabled by default] ... I don't want all default warnings as error.

EDIT: what would be the flag to make it an active error with "-Werror=XXX"


Viewing all articles
Browse latest Browse all 22002

Trending Articles



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