Commit 82514696 by Kaveh R. Ghazi Committed by Kaveh Ghazi

calls.c (special_function_p): Remove `realloc' and add `strdup' to the list of…

calls.c (special_function_p): Remove `realloc' and add `strdup' to the list of functions which have attribute...

        * calls.c (special_function_p): Remove `realloc' and add `strdup'
        to the list of functions which have attribute malloc by default.

From-SVN: r30731
parent 48776cde
1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* calls.c (special_function_p): Remove `realloc' and add `strdup'
to the list of functions which have attribute malloc by default.
1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-lex.c (yylex): With -Wtraditional, when the ANSI type of an * c-lex.c (yylex): With -Wtraditional, when the ANSI type of an
integer constant does not match the traditional type, limit the integer constant does not match the traditional type, limit the
warnings to cases where the base of the type is ten. warnings to cases where the base of the type is ten.
......
...@@ -607,10 +607,12 @@ special_function_p (name, fndecl, returns_twice, is_longjmp, ...@@ -607,10 +607,12 @@ special_function_p (name, fndecl, returns_twice, is_longjmp,
&& ! strcmp (tname, "longjmp")) && ! strcmp (tname, "longjmp"))
*is_longjmp = 1; *is_longjmp = 1;
/* Do not add any more malloc-like functions to this list, /* Do not add any more malloc-like functions to this list,
instead mark as malloc functions using the malloc attribute. */ instead mark them as malloc functions using the malloc attribute.
Note, realloc is not suitable for attribute malloc since
it may return the same address across multiple calls. */
else if (! strcmp (tname, "malloc") else if (! strcmp (tname, "malloc")
|| ! strcmp (tname, "calloc") || ! strcmp (tname, "calloc")
|| ! strcmp (tname, "realloc") || ! strcmp (tname, "strdup")
/* Note use of NAME rather than TNAME here. These functions /* Note use of NAME rather than TNAME here. These functions
are only reserved when preceded with __. */ are only reserved when preceded with __. */
|| ! strcmp (name, "__vn") /* mangled __builtin_vec_new */ || ! strcmp (name, "__vn") /* mangled __builtin_vec_new */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment