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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-09-21
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  The handling of variadic functions was discussed during the design
of the -Wcast-function-type warning
(https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00131.html).  The assumption was
that such conversions may be common and the idea was to avoid warning when
they're safe.  I don't think the warning implementation considers the nuances
between different ABIs.  Rather than customizing the warning to each ABI it
might be better to simply tighten it up across the board as suggested.

Not sure if making the warning "smarter" by having it track pointer conversions
across assignments (to detect incompatible function conversions via void*) is
worth exploring.  It would still not detect the problem in the dlsym() case
(and others like it) but could lead to a fair amount of noise.

Reply via email to