Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable warnings being treated as errors(cc1.exe)

Tags:

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.

like image 675
Sarim Sidd Avatar asked Apr 20 '12 14:04

Sarim Sidd


People also ask

How do I turn off all warnings being treated as errors?

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).

How do I ignore a warning in Makefile?

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.

How do I turn off compiler warnings?

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.

How do I ignore warnings in CPP?

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.

How do I disable the same warnings as errors?

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.

How do I disable warnings when a compiler displays an error?

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.

What is “CC1” error in makefile?

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.

How do I get information about an error or warning?

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.


2 Answers

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.

like image 55
Daniel Roethlisberger Avatar answered Oct 22 '22 10:10

Daniel Roethlisberger


Run this Command in Terminal to say, not to consider warning as error

make CFLAGS="-Wno-error=format-truncation" 
like image 26
Be Champzz Avatar answered Oct 22 '22 08:10

Be Champzz