[PATCH] No 'unsigned vs. 0' warnings in system headers

Chip Salzenberg chip@valinux.com
Wed Jun 28 16:44:00 GMT 2000


This fixes bootstrapping with libstdc++-v3.


2000-06-28  Chip Salzenberg  <chip@valinux.com>

	* c-common.c (shorten_compare): Quiet warnings about unsigned
	comparisons with zero when they occur in a system header.
	
Index: c-common.c
diff -u -2 -p -c -r1.121 c-common.c
cvs server: conflicting specifications of output style
*** c-common.c	2000/06/25 17:27:27	1.121
--- c-common.c	2000/06/28 23:37:52
*************** shorten_compare (op0_ptr, op1_ptr, resty
*** 2811,2815 ****
  		 >= 0, the signedness of the comparison isn't an issue,
  		 so suppress the warning.  */
! 	      if (extra_warnings
  		  && ! (TREE_CODE (primop0) == INTEGER_CST
  			&& ! TREE_OVERFLOW (convert (signed_type (type),
--- 2811,2815 ----
  		 >= 0, the signedness of the comparison isn't an issue,
  		 so suppress the warning.  */
! 	      if (extra_warnings && !in_system_header
  		  && ! (TREE_CODE (primop0) == INTEGER_CST
  			&& ! TREE_OVERFLOW (convert (signed_type (type),
*************** shorten_compare (op0_ptr, op1_ptr, resty
*** 2820,2824 ****
  
  	    case LT_EXPR:
! 	      if (extra_warnings
  		  && ! (TREE_CODE (primop0) == INTEGER_CST
  			&& ! TREE_OVERFLOW (convert (signed_type (type),
--- 2820,2824 ----
  
  	    case LT_EXPR:
! 	      if (extra_warnings && !in_system_header
  		  && ! (TREE_CODE (primop0) == INTEGER_CST
  			&& ! TREE_OVERFLOW (convert (signed_type (type),

-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K


More information about the Gcc-bugs mailing list