Re: Counter intuitively, asserts hurt gcc static dataflow analysis.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 10/05/18 00:30, John Carter wrote:

It catches things that can be inlined but seen as constant at comile time.

I think as gcc's optimizer get's smarter this will be quite a win.

It also basically subsumes static_assert()

This does not replace static_assert. The key point about static_assert is that it is /always/ static - zero cost at run-time or code size. You know that is the case when you write it, and other people reading the code know that. So static_asserts are always free, and can be used liberally. With an assert() modified to give compile-time warnings when possible, you will generally have run-time costs.






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux