diff options
| author | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-06 21:22:02 +0000 |
|---|---|---|
| committer | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-06 21:22:02 +0000 |
| commit | a5147fca1106e5c46821c63b14e8366a65ec0dff (patch) | |
| tree | c13d1c358e9b4295a74856f820ffd37c7785c650 /gcc/c-common.c | |
| parent | b37d9d865b7c4561b84c8dd9527fbc8d74fea6ef (diff) | |
| download | ppe42-gcc-a5147fca1106e5c46821c63b14e8366a65ec0dff.tar.gz ppe42-gcc-a5147fca1106e5c46821c63b14e8366a65ec0dff.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
| -rw-r--r-- | gcc/c-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 817d939be3b..f68c8532ebe 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); |

