[Bug c/38575] free() accept argument that has the same name with standard/builtin function
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Dec 19 03:17:00 GMT 2008
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-19 03:16 -------
Yes you are passing free a function pointer. a function decays to a function
pointer and an implicit conversion to void* happens.
If you use -pedantic you get an error message as a function pointer cannot be
converted to void* in standard C:
t.c:4: error: ISO C forbids passing argument 1 of 'free' between function
pointer and 'void *'
/usr/include/stdlib.h:159: note: expected 'void *' but argument is of type 'int
(*)(void)'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38575
More information about the Gcc-bugs
mailing list