https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105654
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |egallager at gcc dot gnu.org
--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> ```
> ...
> get_bool(_Bool *out);
>
> union __attribute__((transparent_union)) some_pointer {
> void *as_void_ptr;
> _Bool* as_bool_ptr;
> };
>
> void generic_get(union some_pointer);
>
> static typeof(generic_get) *get =
> get_bool;
> ...
> (*get)(&value); // call through function pointer
> ```
>
> I am not sure this is defined code at all. Even though the argument passing
> between the 2 function types are defined to be the same; the union and
> pointer are 2 different types and GCC considers that to true.
>
> I think strongswan needs to remove this kind of hacks. And just use `void*`
> as the argument type and then cast it to the correct type inside the
> function.
A diagnostic to say so would be helpful, if one isn't already being emitted
(if one is, then perhaps it could be clarified?)