Add pragma(error) and pragma(warning) to the language.

Justin Whear justin at economicmodeling.com
Thu Nov 10 11:12:02 PST 2011


How would pragma(error) differ from "static assert(false, 
errorMessageHere)"?


Tobias Pankrath wrote:

> I'm currently writing some template based code and there are
> situations, when I want to issue warnings or errors to users of my code.
> 
> I know of pragma(msg), but the output will be formatted differently from
> the normal compiler warnings / errors. This is bad for tool integration
> and the messages will likely not catch the eye of a normal user.
> 
> Therefore I propose to add two pragmas pragma(error) and pragma(warning)
> to the core language, which work just like pragma(msg), but will format
> the message the way, the compiler would format
> its own error messages or warnings.
> 
> pragma(error) should cause a real compile error, too.
> 
> What do you think?



More information about the Digitalmars-d mailing list