-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[Clang] Missing flag to allow using [[gnu::init_priority]]
in source files
#121108
Comments
@llvm/issue-subscribers-clang-frontend Author: Nikolas Klauser (philnik777)
Currently it's not possible to use `[[gnu::init_priority(100)]]` in source files except by using line control markers. It would be way nicer if there was a diagnostic group to disable this with the diagnostic being an error by default. GCC currently accepts this with a warning without a group instead, which is also annoying, but not as bad as making it only possible with a hack.
|
CC @erichkeane |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Nikolas Klauser (philnik777)
Currently it's not possible to use `[[gnu::init_priority(100)]]` in source files except by using line control markers. It would be way nicer if there was a diagnostic group to disable this with the diagnostic being an error by default. GCC currently accepts this with a warning without a group instead, which is also annoying, but not as bad as making it only possible with a hack.
|
Repro: https://godbolt.org/z/4T7ecxvjT I think it is perfectly reasonable to emit the same warning (with a warning group of course) as GCC for this situation. This is likely a very simple fix, so I'll mark this as a good first issue. This should be a very simple addition of a diagnostic, then changing the handler to just emit the warning instead. |
Hello, I'm new here and I would like to work on this. |
Assigned! Please let me know if you have trouble with this, and let me know when you give up on this so others can take this. |
Currently it's not possible to use
[[gnu::init_priority(100)]]
in source files except by using line control markers. It would be way nicer if there was a diagnostic group to disable this with the diagnostic being an error by default. GCC currently accepts this with a warning without a group instead, which is also annoying, but not as bad as making it only possible with a hack.The text was updated successfully, but these errors were encountered: