array subscript is below array bounds : false positive?

Basile STARYNKEVITCH basile@starynkevitch.net
Tue Sep 15 10:30:00 GMT 2009


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



More information about the Gcc mailing list