[Bug c/6906] warn about asserts with side effects
felix.von.s at posteo dot de
gcc-bugzilla@gcc.gnu.org
Mon Jul 17 13:29:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6906
felix <felix.von.s at posteo dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |felix.von.s at posteo dot de
--- Comment #7 from felix <felix.von.s at posteo dot de> ---
What's wrong with the __builtin_pure_p approach? Sure, the diagnostics
generated by __attribute__((warning)) will be ugly, but it's still something.
It's also very simple to implement: it's just !TREE_SIDE_EFFECTS().
In fact, I patched my copy of GCC to add __builtin_pure_p defined just like
that and it seems to work fine. Might submit it soon (I didn't write any tests,
though).
More information about the Gcc-bugs
mailing list