Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: rittwik on July 29, 2008, 07:43:38 am

Title: Too many error or warning masseges
Post by: rittwik on July 29, 2008, 07:43:38 am
Hi,

I am using Borland Comand Line Tool 5.5, in WinXp SP2.
While compiling a project Code::Blocks gives one error message

Code
Error E2228 main.cpp 2118: Too many error or warning messages
*** 1 errors in Compile ***

There is no error and 99 warnings...
How can I tell Code::Blocks to ignore those warnings and compile the project?

Thanks
Rittwik
Title: Re: Too many error or warning masseges
Post by: thomas on July 29, 2008, 09:31:06 am
Code::Blocks does not output things like "E2228", it's your compiler that is giving up.
Write better code, get less warnings.
Title: Re: Too many error or warning masseges
Post by: rittwik on July 30, 2008, 06:38:36 am
Thanks Thomas for you reply.
You are right, Borland compiler is stop compiling the project after too many warnings.
Actually I am using GDI+ (of microsoft) in a project where the compiler is Borland 5.5.
So not all the warnings are due to my code. Anyway, I found a "temporary" solution.
For those who may need
if you add "-gn" (without quotes) where n is a number between 0 to 255, in the compiler option
then Borland Compiler will ignore first n messages

Thanks rittwik
Title: Re: Too many error or warning masseges
Post by: El_Zorro on August 01, 2008, 06:59:32 am
You could also try using the preprocessor #pragma to disable specific warnings, like this:

Code
// Disable warning
#pragma warning( disable : 4800 )

// Code here doesn't generate the warning

// Restores warning default setting
#pragma warning( default : 4800 )

Another option:

Code
// Save warning state
#pragma warning( push )
#pragma warning( disable : 4834 )
#pragma warning( disable : 4835 )
#pragma warning( disable : 4700 )

// Some code here that avoids those warnings

// Restore saved state
#pragma warning( pop )

Replace the numbers after "disable" and "default" for the warning numbers that you get when compiling.
Title: Re: Too many error or warning masseges
Post by: rittwik on August 06, 2008, 09:59:30 am
Thank you El_Zorro.... That help a lot...