THE WAKE UP CHANNEL
Go to bottomPage: 1
TOPIC:
#1129
Compiler support for #error preprocessor directive 3 Months, 2 Weeks ago Karma: 0
Requesting this in future version of compiler/ preprocessor. Why? Real handy for emitting compile time error messages when validating constants at compile time. Basically using modified ASSERT macro to validate ranges of constants. With #error one can emit an error message indicating an out of range condition.

The Zilog ASSERT macro, as written, uses printf() as the error message vehicle. Not very handy since the error will get emitted only at run time when the validation code is run AND will only do something useful if I happen to have a terminal/ emulator connected to one of the serial ports deliberately assigned to the printf() output. I'm using my serial ports for other application specific things, thank you. Erroring out immediately at compile time to the ZDSII output window is much friendlier and useful than waiting for a specific line of code to run and having to sacrifice valueable embedded hardware resources to see the message.

Hope this makes it to the feature request list.

Thanks for reading.
Stephen Ciricillo (User)
Junior Boarder
Posts: 27
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 12/12
The administrator has disabled public write access.
Best regards,
Steve C.
 
#1130
Re:Compiler support for #error preprocessor directive 3 Months, 2 Weeks ago Karma: 0
OK, slap yourself for reading. Then slap me. It seems that #error is supported and the only way I know is because I tried it. Looking up the error code emitted (38) led me to an explanation indicating it is supported.

Just ignore this.
Stephen Ciricillo (User)
Junior Boarder
Posts: 27
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 12/12
The administrator has disabled public write access.
Best regards,
Steve C.
 
Go to topPage: 1