[Bug middle-end/90302] Implement __builtin_warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302 Jonathan Wakely changed: What|Removed |Added CC||redi at gcc dot gnu.org --- Comment #5 from Jonathan Wakely --- This would be very useful for the C++ library where we currently have precondition checks that: - abort at runtime if you compile with -D_GLIBCXX_ASSERTIONS, or - fail at compile-time if they are constexpr **and** are actually evaluated during constexpr evaluation The runtime assertions are good, but not enabled by default, and an earlier warning at compile time means the problem can be found sooner. The constexpr errors are good, but don't apply to non-constexpr calls, even if all the arguments are known during compilation. It would be nice to be able to also issue warnings for non-constexpr calls, when compiled without -D_GLIBCXX_ASSERTIONS.
[Bug middle-end/90302] Implement __builtin_warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302 --- Comment #4 from Thomas Koenig --- There is a prototype patch by Martin Sebor at https://gcc.gnu.org/pipermail/gcc-patches/2019-October/531812.html
[Bug middle-end/90302] Implement __builtin_warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302 --- Comment #3 from Richard Biener --- I'm not sure a function call is the proper way to handle this. It would maybe be better to use a DEBUG-stmt like thing (maybe even actually a debug stmt!). In theory it would be possible to emit those into DWARF and trigger the warnings at runtime (under inspection of an appropriate tool like valgrind).
[Bug middle-end/90302] Implement __builtin_warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2019-05-01 CC||msebor at gcc dot gnu.org See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=89337, ||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=48655 Ever confirmed|0 |1 --- Comment #2 from Martin Sebor --- As Jeff said this would be useful to avoid false positives in cases like bug 89337 comment #12.
[Bug middle-end/90302] Implement __builtin_warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302 --- Comment #1 from Andrew Pinski --- Error can be implement using the error attribute on a function.