This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: array subscript is below array bounds : false positive?
- From: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- To: "Peter A. Felvegi" <petschy at praire-chicken dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 15 Sep 2009 12:30:14 +0200
- Subject: Re: array subscript is below array bounds : false positive?
- References: <4AAF6A13.2090303@praire-chicken.com>
Peter A. Felvegi wrote:
Hello,
---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8----
#define ASSERT(x) if (x) { } else { __asm__("int $0x03"); }
With the trunk, that is future 4.5, I would suggest
#define ASSERT(x) if (x) {} else {__builtin_unreachable ();}
or at least, if the int$03 is important,
#define ASSERT(x) if (!(x)) \
{ volatile __asm__("int $0x03");__builtin_unreachable ();}
See
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***