This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: array subscript is below array bounds : false positive?


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} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]