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]

__builtin_choose_expr: type-genericity and side-effects


Hi,

I'm currently implementing a few type-generic macros in C with
__builtin_choose_expr and noticed the following:

1) The documentation does not mention if const_expr has side-effects.
One may, for example, use the return type of a function call; I expect
the expression to not be evaluated. The same remark applies also to
typeof.

2) Is it possible to really remove the unused expression? One often
gets either warnings about pointers having the wrong type, or, after
adding all explicit conversions, about strict aliasing.

Although I would strongly prefer a solution to (2), do you know how to
remove the warnings about strict aliasing for one particular conversion
that is known to be safe?

Thanks and best regards,
JÃrg


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