Author Topic: Too many error or warning masseges  (Read 6087 times)

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
Too many error or warning masseges
« 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: [Select]
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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Too many error or warning masseges
« Reply #1 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
Re: Too many error or warning masseges
« Reply #2 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

El_Zorro

  • Guest
Re: Too many error or warning masseges
« Reply #3 on: August 01, 2008, 06:59:32 am »
You could also try using the preprocessor #pragma to disable specific warnings, like this:

Code: [Select]
// Disable warning
#pragma warning( disable : 4800 )

// Code here doesn't generate the warning

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

Another option:

Code: [Select]
// 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.

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
Re: Too many error or warning masseges
« Reply #4 on: August 06, 2008, 09:59:30 am »
Thank you El_Zorro.... That help a lot...