From cf6d9b9c007da9690796187ed18ad92df11ccf53 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 13 Feb 1993 05:41:28 +0000 Subject: [PATCH] (build_indirect_ref): If arg is void *, just warn. From-SVN: r3469 --- gcc/c-typeck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 7bbad1443bd..e8a483a4108 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1119,12 +1119,13 @@ build_indirect_ref (ptr, errorstring) register tree ref = build1 (INDIRECT_REF, TYPE_MAIN_VARIANT (t), pointer); - if (TREE_CODE (t) == VOID_TYPE - || (TYPE_SIZE (t) == 0 && TREE_CODE (t) != ARRAY_TYPE)) + if (TYPE_SIZE (t) == 0 && TREE_CODE (t) != ARRAY_TYPE) { error ("dereferencing pointer to incomplete type"); return error_mark_node; } + if (TREE_CODE (t) == VOID_TYPE) + warning ("dereferencing `void *' pointer"); /* We *must* set TREE_READONLY when dereferencing a pointer to const, so that we get the proper error message if the result is used -- 2.30.2