Raised This Month: $51 Target: $400
 12% 

Preprocessor Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 02-05-2016 , 19:08   Preprocessor Messages
Reply With Quote #1

To my knowledge, research, and testing, sourcepawn does not have the ability to add preprocessor messages to the compiler output like some C languages.

e.g.
Code:
#warning "SHOW THIS MESSAGE AS A WARNING DURING COMPILE"
or
Code:
#pragma message "SHOW THIS MESSAGE AS A WARNING DURING COMPILE"
Am I mistaken? If not, would I submit a "bug" report to ask to have it added, or how would I go about asking?

In case you're wondering, I use conditional processing to include or not include certain bits of code in plugins (e.g. debug modes). I wanted my compiler to print a warning under certain conditions.

e.g.
Code:
#if defined(DEBUG_MODE) || defined(SOME_OTHER_DEFINE)
	#warning "DEBUG MODE IS ENABLED!!"
#endif
or even..
Code:
#if defined(DEBUG_MODE) || defined(SOME_OTHER_DEFINE)
	#include <some_include_file>
	#warning "SOME NOTE HERE!"
#endif
This would be helpful for coders to realize if they forgot to do something. Heck, you could even use it as a "to do" list, sending yourself warnings until you write in the "to do" code and remove the warning. Thoughts?
__________________
ThatOneGuy is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 02-05-2016 , 20:24   Re: Preprocessor Messages
Reply With Quote #2

Pawn itself doesn't have any such options, so I feel it would be quite unexpected for it to be in SourcePawn. Pawn does offer #error and #assert which would offer the same effect of causing you to go back and realize you had done something unintended or comment the ASSERT.
http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf
__________________
databomb is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 02-05-2016 , 23:52   Re: Preprocessor Messages
Reply With Quote #3

Yea, i didnt want to abort the compile...just wanted to give a nice colored note when i compile in NPP. I'm hoping there is a way I dont know about to echo the messages.
__________________
ThatOneGuy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode