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