This is the mail archive of the
mailing list for the GCC project.
__builtin_choose_expr: type-genericity and side-effects
- From: Jörg Leis <joerg at joergleis dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 25 Apr 2010 00:55:30 +0200
- Subject: __builtin_choose_expr: type-genericity and side-effects
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
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,