D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11578 - Add pragma error, warning
Summary: Add pragma error, warning
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2013-11-21 23:07 UTC by Richard (Rikki) Andrew Cattermole
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Richard (Rikki) Andrew Cattermole 2013-11-21 23:07:45 UTC
For language manipulation features like AST macros hooks into error and warning at the compiler may add value in the future.
Proposal is to add pragma(error,) and pragma(warning,).
They should behave as pragma(msg,) except be hooked into the compilers warning and error systems.

There is currently static assert(0, ) which does do close to what pragma(error,) proposed does however it also does prepend "static assert" to the output. Because of this the purpose to me is different.
However if pragma(warning,) was to be added and not pragma(error,) it would be confusing for new users to not have it all in one place.
Comment 1 yebblies 2013-11-22 00:21:58 UTC
This has an existing pull request:

https://github.com/D-Programming-Language/dmd/pull/2755
Comment 2 Richard (Rikki) Andrew Cattermole 2013-11-23 22:27:40 UTC
(In reply to comment #1)
> This has an existing pull request:
> 
> https://github.com/D-Programming-Language/dmd/pull/2755

I know I created it. I only created this at request.
Comment 3 Richard (Rikki) Andrew Cattermole 2013-11-23 22:27:40 UTC
(In reply to comment #1)
> This has an existing pull request:
> 
> https://github.com/D-Programming-Language/dmd/pull/2755

I know I created it. I only created this at request.
Comment 4 yebblies 2013-11-23 22:36:50 UTC
(In reply to comment #3)
> 
> I know I created it. I only created this at request.

I know, I can read.  The two are supposed to be cross-linked, so progress can be tracked, and old work can be found if the pull is closed.
Comment 5 basile-z 2020-02-20 15:22:28 UTC
The attempt to add this feature was rejected

"pragma error would be redundant with static assert, and pragma warning is redundant with pragma msg."