WARNING pragma - #452
Conversation
fe29da5 to
6e77cf0
Compare
| - `note 6` Warning and error messages reported by DMLC now display the tag for | ||
| the warning/error kind by default. The old behavior of having the tag | ||
| be omitted now requires passing `--no-tags` to DMLC. With this change, the | ||
| `-T` flag has become a no-op and will be removed in a future version. No newline at end of file |
There was a problem hiding this comment.
Keeping -T around is a spitball on my part; I'm interested in your opinion. Also instead of vaguely saying "a future version" we could tie it to the specified --simics-api and not accept -T when used with API version 8 or above.
| /*% WARNING WREDUNDANTLEVEL %*/ | ||
| /*% WARNING WNEGCONSTCOMP %*/ | ||
| log info, 1 then then_level: "%s", i == special ? "special" : "regular"; | ||
| } |
There was a problem hiding this comment.
You have no idea how difficult it was to concoct a semi-realistic case where applying a WARNING pragma twice on the same line would be warranted. We don't have enough warning kinds ;)
| # the <tt>-\-nowarn</tt> and <tt>-\-warn</tt> options.</dd> | ||
| # <dt>-\-no-tags</dt> | ||
| # <dd>Disables showing the tag associated with each error or warning | ||
| # message.</dd> |
There was a problem hiding this comment.
should we even bother?
| + "warning, specify " | ||
| + "'provisional simics_util_vect;' at " | ||
| + "the top of the file, after" | ||
| + 'dml 1.4;')) |
There was a problem hiding this comment.
I did this as I was concerned about the novel WARNING pragma being used instead of the much more preferable option to leverage provisional simics_util_vect;
There was a problem hiding this comment.
Pull request overview
Adds granular DML 1.4 WARNING pragmas, line-based suppression, and diagnostic-tag updates.
Changes:
- Adds warning parsing, validation, suppression, and tests.
- Refactors shared pragma and cached-AST handling.
- Updates CLI behavior, documentation, and release notes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Summary |
|---|---|
test/1.4/pragmas/T_WARNING.dml |
Tests warning suppression. |
test/1.4/errors/T_EWARNING.dml |
Tests invalid warning tags. |
RELEASENOTES.md |
Documents pragma and tag changes. |
py/dml/toplevel.py |
Parses and processes pragmas. Critical: legacy .dmlast pragma tuples can cause an unpacking failure. |
py/dml/output.py |
Applies Coverity pragmas. |
py/dml/messages.py |
Adds invalid-tag diagnostics. |
py/dml/logging.py |
Implements line-based warning suppression. Nit: rename the misspelled occurence helper. |
py/dml/globals.py |
Stores line-based pragmas. |
py/dml/dmlparse.py |
Expands vect warning guidance. Nit: add the missing space in after dml. |
py/dml/dmlc.py |
Updates diagnostic-tag options. Moderate: --no-tags does not disable tags. |
doc/1.4/language.md |
Documents WARNING pragmas. Nit: correct subject–verb agreement. |
Suppressed comments (2)
py/dml/dmlc.py:372
- The command-line reference still documents
-Tas the switch that enables tags and does not document the new--no-tagsoption. Since this hunk makes-Ta no-op, updatedoc/1.4/running-dmlc.md(and any generated copy) so users are not directed to an obsolete behavior.
# <dt>-\-no-tags</dt>
# <dd>Disables showing the tag associated with each error or warning
# message.</dd>
parser.add_argument(
'--no-tags', dest='include_tag', action='store_false',
help='disable tags on error and warning messages')
py/dml/toplevel.py:245
produce_dmlast()stores the result ofparse_pragmas()but does not callprocess_pragma()before parsing or saving the AST. Consequently, an invalidWARNINGtag is accepted while generating a.dmlastcache (and any parse-time warning is not suppressed), whereas direct source parsing reports/handles it. Validate and register the pragmas during cache production as well, beforeparse().
return (pragma, filename, start_lineno, end_lineno + 1, data)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
PR Verification: ❌ failure |
6e77cf0 to
a5e1764
Compare
a5e1764 to
0654c96
Compare
|
PR Verification: ❌ failure |
|
Verification failure is unrelated. |
No description provided.