https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114731

Martin Uecker <muecker at gwdg dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |muecker at gwdg dot de

--- Comment #18 from Martin Uecker <muecker at gwdg dot de> ---

In theory, we could do something like this, but note that this also has
undesirable consequences: This would turn off all such warnings also in
expressions passed as macro arguments, i.e. this would substantially reduce
type safety for expressions you pass to your 'a2i' macro and also affect other
sub expressions one might have inside the implementation of such macros. We
could try to be smart and find heuristics to avoid this, but then it already
gets more difficult. 

I personally find the version with the casts acceptable. I would suggest o
implement the type tests also using _Generic instead of using the builtin. For
example, you could do something like:

#define a2i(TYPE, ...) \
 _Generic((n),  \
 long: a2sl(_Generic((n), TYPE: (long*)(n), s, endp, base, min, max), \
 ...)

Reply via email to