This is the mail archive of the gcc-help@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: gcc_assert


ranjith kumar <ranjit_kumar_b4u@yahoo.co.uk> writes:

> What is the purpose of gcc_assert() function?
> Any resource please.
> 
> 
>    574 #define gcc_assert(EXPR)                       
>                         \
>     575    ((void)(!(EXPR) ? fancy_abort (__FILE__,
> __LINE__, __FUNCTION__), 0 : 0))
>     576 #else
>     577 /* Include EXPR, so that unused variable
> warnings do not occur.  */
>     578 #define gcc_assert(EXPR) ((void)(0 && (EXPR)))
>     579 #endif

It's a version of the standard assert function used in the gcc
sources.  For gcc's purposes it is better than assert because dumping
core is under the control of the -dH option.

Ian


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