Jump to content
  • Advertisement

Archived

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

SikCiv

Displaying a Warning purposely in VC?

This topic is 6911 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 use the Command line based compiler in Visual C++ 6 (cl.exe i think its called) via the use of a makefile and nmake.exe, so when I compile, it shows me the errors and warnings in a dos box. I was wandering if u can produce your own warning message? A good example would be when I code a new function, but couldnt be bothered to put all the features in the function at the present moment, I need something to hit me in the face to tell me I need to update the function at a later date. A warning from the compiler output would be fantasia... as so.. void MyFunkyNewFunktion() { NewCode3 != bla.bla[1]; NewCode2 /= bla.bla[2]; NewCode1 &= bla.bla[3]; // HACK: Couldnt be bothered at the moment... VCCompilerWarning("REMEMBER TO UPDATE MyFunkyNewFunction!"); } Compiler Output would be: Game.cpp(1201) : Warning C9999 REMEMBER TO UPDATE MyFunkyNewFunction! Possible?

Share this post


Link to post
Share on other sites
Advertisement
Thats not what im looking for. The Warning Preprocessor Directive only does things like disable certain warnings.

I need a Custom Warning message.

Or is there a text-output message function that outputs at the compiler output?

Share this post


Link to post
Share on other sites
Whats the syntax? Ive looked in the VStudio help, but its almost always impossible to find what u are looking for )-;
So I tried...

#Warning "blabla"
and..
#warning "blabla"

But when I compile it it says Invalid Preprocessor command.

Some code sample would help.


Share this post


Link to post
Share on other sites
what I think you''re looking for is:

#pragma message( messagestring )

do a search in help for #pragma to find the help for this function

Share this post


Link to post
Share on other sites
Oh, oops... I failed to notice that the #warning I saw was a J++ thing... my fault. I know there is #error, which is why I didn't read too far into the #warning topic (there's one tiny little thing at the end that would have given me a clue).

What you really are looking for, I think is

#pragma message( messagestring )

This doesn't produce a warning, but it does put a message out to the standard output.

Sorry again for being midleading. I just wasn't thinking straight earlier this week.

Mark Fassett
Laughing Dragon Entertainment
http://www.laughing-dragon.com

And apparently, I'm still not thinking straight... I didn't notice what Gav pointed you to...

Edited by - LaughingD on May 19, 2000 5:27:11 PM

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!