Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

How do you 'shut-up' warnings?

This topic is 5399 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on a project in Dev-C++, but I programmed a ''warning''.. It''s not a bug or an error, so I''m trying to remove the warning out of my compile log. Is there a (prefered: standard) way to do this? .lick

Share this post


Link to post
Share on other sites
Advertisement
Well, warnings often-times need to be fixed just as errors do...people who disable warnings are basically ignoring help from their compiler telling them something is wrong.

EDIT: That is called taking the address of a temporary variable...that is a bad thing. And yes, I believe you *are* supposed to create three temporary vars (if they're all to 0,0,0 though, you could just create one and reference it 3 times).

[edited by - AikonIV on October 10, 2003 8:58:48 AM]

Share this post


Link to post
Share on other sites
I always set my c++ compiler settings to Level 4 (sticter settings that expose more warnings). I wish that was the DEFAULT behavior.

Pipo can you post more code (and the warning message)? I did similar things and I want to compare any differences.

Share this post


Link to post
Share on other sites
There''s not a universal standard but many compilers support a "#pragma warning" construct. Look it up in your help and see if your compiler supports it.

Share this post


Link to post
Share on other sites
Ignoring warnings should be done with extreme caution. As others have pointed out, it''s usually a sign that something is wrong with your program. I''ve worked with programmers who happily ignore warnings because, after all, "they''re just warnings". Then they don''t understand why the program crashes unexpectedly in production.

--
Dave Mikesell
d.mikesell@computer.org
http://davemikesell.com

Share this post


Link to post
Share on other sites
quote:
DirectX9 SDK document
D3DXMATRIX matView;
D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 3.0f,-5.0f ),
&D3DXVECTOR3( 0.0f, 0.0f, 0.0f ),
&D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) );
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );

quote:
Dev-C++ 5 beta (mingw??)
[ Warning ] taking address of temporary


I REALLY REALLY don''t think this warning will crash my program, or create a bug somewhere in it.
Thanks MauMan, I''ll have a look.

.lick

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!