[ccan] useless expression in typesaft_cb_cast

Yubin Ruan ablacktshirt at gmail.com
Mon Mar 12 07:05:27 AEDT 2018


Hi,

typesaft_cb_cast() is defined in typesaft_cb.h as:

    #define typesafe_cb_cast(desttype, oktype, expr)                  \
    	__builtin_choose_expr(                                        \
    		__builtin_types_compatible_p(__typeof__(0?(expr):(expr)), \
    					     oktype),                                 \
    		(desttype)(expr), (expr))

what is the point of that "0?(expr):(expr)" ?

Yubin


More information about the ccan mailing list