aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJames A. Morrison <phython@gcc.gnu.org>2005-04-06 21:22:02 +0000
committerJames A. Morrison <phython@gcc.gnu.org>2005-04-06 21:22:02 +0000
commit3425638af52c359b893547b9dcde5cccd1bb67ac (patch)
treec13d1c358e9b4295a74856f820ffd37c7785c650 /gcc/c-common.c
parent53ae8e14b24bcaf60acdc0d8ee6683ea741cee13 (diff)
downloadgcc-3425638af52c359b893547b9dcde5cccd1bb67ac.zip
gcc-3425638af52c359b893547b9dcde5cccd1bb67ac.tar.gz
gcc-3425638af52c359b893547b9dcde5cccd1bb67ac.tar.bz2
c-common.c (handle_malloc_atttribute): Only set DECL_IS_MALLOC if the function returns a pointer type.
2005-04-06 James A. Morrison <phython@gcc.gnu.org> * c-common.c (handle_malloc_atttribute): Only set DECL_IS_MALLOC if the function returns a pointer type. From-SVN: r97751
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 817d939..f68c853 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -4808,9 +4808,9 @@ static tree
handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- if (TREE_CODE (*node) == FUNCTION_DECL)
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
DECL_IS_MALLOC (*node) = 1;
- /* ??? TODO: Support types. */
else
{
warning ("%qE attribute ignored", name);