Re: telling GCC that a pointer cannot be NULL

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

 



On 10 May 2011 16:42, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> As of gcc 4.5 you can do this using __builtin_unreachable.

Thanks, this is what I was looking for!

> Use this with care. ÂIf you get it wrong, the results will be wholly
> unpredictable.

I guess enough care could be archived using an assert like in:

#ifdef NDEBUG
#define optimization_assert(cond) do { if (!(cond))
__builtin_unreachable(); } while (0);
#else
#define optimization_assert(cond) assert(cond)
#endif



[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