woohoo n00b up and running with help, thanks to all 
Author Message
 woohoo n00b up and running with help, thanks to all

Now I compile a tiny program and I get 261 completely bogus (in that
they are about compiler implementation issues of no interest to me)
"warning C4786" outputs, completely hiding any comments the compiler has
on my code that I might like to pay attention to...

Hunt hunt, hunt hunt. Ah! #pragma warning(disable: 4786)

Now I get *226* warning C4786 etc... huh? So the compiler isn't QUITE
ignoring me, the count changed - just not to zero. Well, That's Funny???

This has gotta be an oldie but goodie, what's the secret trick?

--



Mon, 28 Jun 2004 07:35:55 GMT  
 woohoo n00b up and running with help, thanks to all

Quote:
> Now I compile a tiny program and I get 261 completely bogus (in that
> they are about compiler implementation issues of no interest to me)
> "warning C4786" outputs, completely hiding any comments the compiler has
> on my code that I might like to pay attention to...

> Hunt hunt, hunt hunt. Ah! #pragma warning(disable: 4786)

> Now I get *226* warning C4786 etc... huh? So the compiler isn't QUITE
> ignoring me, the count changed - just not to zero. Well, That's Funny???

> This has gotta be an oldie but goodie, what's the secret trick?

I use the following code:

#pragma warning(push)
#pragma warning(disable:4786)
#include <yvals.h>
#pragma warning(disable:4786)
#include <vector> // or whatever stl header you choose
#pragma warning(pop)

The problem is that somewhere deep in the STL, the warnings get reenabled. By
first including a lower level STL header and then disabling warnings again,
that header will not get included a second time and the disabling will work
correctly.



Mon, 28 Jun 2004 09:41:15 GMT  
 woohoo n00b up and running with help, thanks to all
You also have to disable them *very* early on - *before* you include
any STL header files. Disabling them before the warnings show up is
not sufficient.
Quote:



> > Now I compile a tiny program and I get 261 completely bogus (in that
> > they are about compiler implementation issues of no interest to me)
> > "warning C4786" outputs, completely hiding any comments the compiler has
> > on my code that I might like to pay attention to...

> > Hunt hunt, hunt hunt. Ah! #pragma warning(disable: 4786)

> > Now I get *226* warning C4786 etc... huh? So the compiler isn't QUITE
> > ignoring me, the count changed - just not to zero. Well, That's Funny???

> > This has gotta be an oldie but goodie, what's the secret trick?

> I use the following code:

> #pragma warning(push)
> #pragma warning(disable:4786)
> #include <yvals.h>
> #pragma warning(disable:4786)
> #include <vector> // or whatever stl header you choose
> #pragma warning(pop)

> The problem is that somewhere deep in the STL, the warnings get reenabled. By
> first including a lower level STL header and then disabling warnings again,
> that header will not get included a second time and the disabling will work
> correctly.



Mon, 28 Jun 2004 13:13:52 GMT  
 woohoo n00b up and running with help, thanks to all


Quote:


> > Now I compile a tiny program and I get 261 completely bogus (in that
> > they are about compiler implementation issues of no interest to me)
> > "warning C4786" outputs, completely hiding any comments the compiler
has
> > on my code that I might like to pay attention to...

> > Hunt hunt, hunt hunt. Ah! #pragma warning(disable: 4786)

> > Now I get *226* warning C4786 etc... huh? So the compiler isn't
QUITE
> > ignoring me, the count changed - just not to zero. Well, That's
Funny???

> > This has gotta be an oldie but goodie, what's the secret trick?

> I use the following code:

> #pragma warning(push)
> #pragma warning(disable:4786)
> #include <yvals.h>
> #pragma warning(disable:4786)
> #include <vector> // or whatever stl header you choose
> #pragma warning(pop)

> The problem is that somewhere deep in the STL, the warnings get
reenabled. By
> first including a lower level STL header and then disabling warnings
again,
> that header will not get included a second time and the disabling will
work
> correctly.

Brilliant == obvious, the second time.

I am in your debt; thank you.

Ed Kaulakis

P.S.
I tried to boil it down to necessary and sufficient, and got this far;
not that I could find where 4786 was referenced in the headers, that
would have been too easy....

// Erik Funkenbusch's hack! Thanks Eric!

#pragma warning(disable:4786)

#pragma warning(push)
#include <string>
#pragma warning(pop)

// continue with disable:4786 in force

#include <map>
#include <iostream>
#include <algorithm>
etc.



Mon, 28 Jun 2004 16:40:12 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. N00b needs help with header file

2. Help a n00b

3. Help pop-ups in MFC App

4. Thanks, Loading and running object code

5. n00b question about searching

6. How can i terminate a Worker Thread during a Thread is running?Thank

7. help determine if a task is still running and kill it if it is running

8. ThinkC : Thank you, thank you, thank you, thank you !!!

9. PLEASE PLEASE...THANKS THANKS!!

10. ANNOUNCE: Updated UPS debugger for Sun, Linux ELF available

11. Updated unofficial patch for UPS 3.14-beta debugger available

12. Fast Cyclic Redundancy Check (CRC) calculations w/o table look-ups

 

 
Powered by phpBB® Forum Software