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]
Other format: [Raw text]

-Wtraditional vs glibc


Fixes

Number of warning types:
    672 traditional C rejects automatic aggregate initialization

which comes from glibc's clever string copy macros.


r~


        * c-parse.in (SAVE_WARN_FLAGS): Save warn_traditional.
        (RESTORE_WARN_FLAGS): Restore it.
        (extension): Zero warn_traditional.

Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.123
diff -c -p -d -r1.123 c-parse.in
*** c-parse.in	2001/12/15 04:06:05	1.123
--- c-parse.in	2001/12/21 18:29:18
*************** static tree declspec_stack;
*** 261,273 ****
  
  /* For __extension__, save/restore the warning flags which are
     controlled by __extension__.  */
! #define SAVE_WARN_FLAGS()	\
! 	size_int (pedantic | (warn_pointer_arith << 1))
! #define RESTORE_WARN_FLAGS(tval) \
!   do {                                     \
!     int val = tree_low_cst (tval, 0);      \
!     pedantic = val & 1;                    \
!     warn_pointer_arith = (val >> 1) & 1;   \
    } while (0)
  
  ifobjc
--- 261,277 ----
  
  /* For __extension__, save/restore the warning flags which are
     controlled by __extension__.  */
! #define SAVE_WARN_FLAGS()			\
! 	size_int (pedantic			\
! 		  | (warn_pointer_arith << 1)	\
! 		  | (warn_traditional << 2))
! 
! #define RESTORE_WARN_FLAGS(tval)		\
!   do {						\
!     int val = tree_low_cst (tval, 0);		\
!     pedantic = val & 1;				\
!     warn_pointer_arith = (val >> 1) & 1;	\
!     warn_traditional = (val >> 2) & 1;		\
    } while (0)
  
  ifobjc
*************** extension:
*** 2620,2626 ****
  	EXTENSION
  		{ $$ = SAVE_WARN_FLAGS();
  		  pedantic = 0;
! 		  warn_pointer_arith = 0; }
  	;
  
  ifobjc
--- 2624,2631 ----
  	EXTENSION
  		{ $$ = SAVE_WARN_FLAGS();
  		  pedantic = 0;
! 		  warn_pointer_arith = 0;
! 		  warn_traditional = 0; }
  	;
  
  ifobjc


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