This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C PATCH: Allow `void' statements



A minor goof in Nathan's recent patch to clean up the completeness of
`void' was causing us to disallow statements like `(void) f ();' in C.

I checked in this patch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-03-21  Mark Mitchell  <mark@codesourcery.com>

	* c-common.c (c_expand_expr_stmt): Use COMPLETE_TYPE_OR_VOID_P,
	not COMPLETE_TYPE_P, to check the type of the expression.

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.c,v
retrieving revision 1.98
diff -c -p -r1.98 c-common.c
*** c-common.c	2000/03/21 18:10:38	1.98
--- c-common.c	2000/03/21 19:32:57
*************** c_expand_expr_stmt (expr)
*** 2139,2145 ****
      expr = default_conversion (expr);
  
    if (TREE_TYPE (expr) != error_mark_node
!       && !COMPLETE_TYPE_P (TREE_TYPE (expr))
        && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE)
      error ("expression statement has incomplete type");
  
--- 2139,2145 ----
      expr = default_conversion (expr);
  
    if (TREE_TYPE (expr) != error_mark_node
!       && !COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (expr))
        && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE)
      error ("expression statement has incomplete type");
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]