I am developing a brew app. When compiling the app to get MOD file, I am continuously getting this error
cc1.exe: warnings being treated as errors
I want to disable this warning. I have googled it, and many says disabling -werror
will help but I don't know how to do that. The compiler is CodeSourcery ARM.
You can make all warnings being treated as such using -Wno-error. You can make specific warnings being treated as such by using -Wno-error=<warning name> where <warning name> is the name of the warning you don't want treated as an error. If you want to entirely disable all warnings, use -w (not recommended).
Maybe you can look for CFLAGS options in Makefile and remove the -Werror flag. The Werror flag will make all warnings into errors. Show activity on this post. In general, it is not a good idea to ignore warnings from your compiler.
Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.
To disable a set of warnings for a given piece of code, you have to start with a “push” pre-processor instruction, then with a disabling instruction for each of the warning you want to suppress, and finish with a “pop” pre-processor instruction.
Disable the same warnings as errors: You use WarningsAsErrors to configure a set of warnings as errors. Use WarningsNotAsErrors to configure a set of warnings that should not be errors when you've set all warnings as errors. The DisabledWarnings option lets you suppress the compiler from displaying one or more warnings.
Use WarningsNotAsErrors to configure a set of warnings that should not be errors when you've set all warnings as errors. The DisabledWarnings option lets you suppress the compiler from displaying one or more warnings.
If you are compiling some C program or open source package using Makefile which is written by someone else, there are chances you may encounter error as “cc1: all warnings being treated as errors” and you will not be able to compile the program or package.
To get information about an error or warning, you can look up the error code in the Help Index. For other ways to get information about an error or warning, see C# Compiler Errors.
You need to remove -Werror
from CFLAGS
, CPPFLAGS
etc.; these are usually set in Makefile's or build scripts.
However, I'd strongly advice to fix the actual warnings instead, which will produce more stable and error-free code.
Run this Command in Terminal to say, not to consider warning as error
make CFLAGS="-Wno-error=format-truncation"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With