This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/68611] New: Recommendation for 'cleanup' variable attribute


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]