This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/68611] New: Recommendation for 'cleanup' variable attribute
- From: "alexreg at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Nov 2015 02:11:35 +0000
- Subject: [Bug c/68611] New: Recommendation for 'cleanup' variable attribute
- Auto-submitted: auto-generated
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.