http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39462
--- Comment #9 from Andrew Pinski 2012-01-08
21:51:17 UTC ---
(In reply to comment #4)
> Also - I admit not having studied in detail all your requirements, sorry about
> that - I suppose you would be interested in static_assert, available with
>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39462
Paolo Carlini changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|gcc-bugs at g
--- Comment #7 from ich at az2000 dot de 2009-03-15 00:58 ---
Hm yea, I thought already about that. But I cannot think of a good (and easy)
definition when an assert() should be checked at compile time and whether not.
And thus, I am not sure if that is something which belongs into the C
--- Comment #6 from paolo dot carlini at oracle dot com 2009-03-15 00:31
---
Hey, no problem really, just wanted to let you aware that the next Standard
will deliver an assert checked at compile time. In general, if you want
something special for the next releases of the C++ Standard, I
--- Comment #5 from ich at az2000 dot de 2009-03-15 00:10 ---
(In reply to comment #4)
> Also - I admit not having studied in detail all your requirements, sorry about
> that - I suppose you would be interested in static_assert, available with
> -std=c++0x, in gcc4.3.x (and 4.4.x, of cou
--- Comment #4 from paolo dot carlini at oracle dot com 2009-03-14 23:41
---
Also - I admit not having studied in detail all your requirements, sorry about
that - I suppose you would be interested in static_assert, available with
-std=c++0x, in gcc4.3.x (and 4.4.x, of course):
http:/
--- Comment #3 from rguenth at gcc dot gnu dot org 2009-03-14 20:25 ---
The attribute is new in GCC 4.3.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39462
--- Comment #2 from ich at az2000 dot de 2009-03-14 19:48 ---
Really thanks a lot for that hint.
I did a small assert-implementation by my own:
http://openlierox.svn.sourceforge.net/viewvc/openlierox/include/cassert?view=markup
Btw., it seems that Apples GCC (even 4.2) does not support
--- Comment #1 from rguenth at gcc dot gnu dot org 2009-03-14 17:33 ---
You should be able to do this already with something like
void do_the_warning (void) __attribute__((warning("assertion always false")));
#define assert(X) \
if (__builtin_constant_p (X) \
&& !(X))