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

            Bug ID: 68611
           Summary: Recommendation for 'cleanup' variable attribute
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexreg at gmail dot com
  Target Milestone: ---

Presently, the `cleanup_function` parameter to the `cleanup` variable attribute
"must take one parameter, a pointer to a type compatible with the variable".
(see
<https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#Common-Variable-Attributes>).
It would be helpful to allow to the function to be compatible more generally –
that is, as far as implicit casts are allowed, when calling a function. For
example, if a `cleanup` attribute is applied to a variable of type `int * *`
and the cleanup function has parameter type `int const * const`, this should be
acceptable, as it is an implicit cast in C.

Reply via email to