-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Comment-Based Warning Control #977
Comments
I'm always skeptical of tools doing any kind of parsing of comments; it feels like a violation of what comments are supposed to be. At least in this case it seems less bad since it's just controlling diagnostic output at the end of the pipeline; comments that modify actual semantics are way worse. Note that it's possible already today to avoid the problem you're describing via simple ifdefs:
That should prevent other tools from complaining. I realize it's a bit verbose, though you can hide it behind a macro:
|
I prefer not to use comments for controlling tool behavior either. However, if we're considering simpler one-line diagnostic controls in the future (something like It's odd that some commercial tools still don't support pragma, especially since it has been in the Verilog spec since before 2005. Here’s a quick check on pragma support in various tools:
Whether to support comment-based control might depend on the need for compatibility with other tools. If maintaining the current approach to do things correctly is important, I understand and respect that. But if compatibility is a higher priority, then using comments might be the way to go. |
Is your feature request related to a problem? Please describe.
Currently,
slang
supports suppressing warnings using pragma directives like:However, the
`pragma
directive is not supported in VCS and result in errors such as:This discrepancy leads to complications in managing code compatibility across different tools.
Describe the solution you'd like
I propose adding an alternative method to control warnings with comments, similar to how clang family handle it. For example,
clang-format
has// clang-format off
,clang-tidy
has// NOLINTNEXTLINE
.This approach would allow for more compatibility with tools that do not support pragma directives.
The text was updated successfully, but these errors were encountered: