[mainline] PATCH to c-pragma.c: Don't use xxx_with_decl

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Jul 19 13:14:00 GMT 2003


This completes the removal of xxx_with_decl from files specific to the
C (and related) front ends.

The removal from the middle and back ends remains to be done.  That
needs some additional infrastructure and reorganization.

Bootstrapped and regtested on an i686-pc-linux-gnu.

-- Gaby

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.566
diff -p -r2.566 ChangeLog
*** ChangeLog	19 Jul 2003 10:19:17 -0000	2.566
--- ChangeLog	19 Jul 2003 13:09:11 -0000
***************
*** 1,5 ****
--- 1,10 ----
  2003-07-19  Gabriel Dos Reis  <gdr@integrable-solutions.net>
  
+ 	* c-pragma.c (apply_pragma_weak): Don't use warning_with_decl.
+ 	* toplev.h (warning): Remove attribute.
+ 
+ 2003-07-19  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
  	* c-decl.c (c_finish_incomplete_decl): Don't use xxx_with_decl.
  	(pop_label_level): Likewise.
  	(duplicate_decls): Likewise.
Index: c-pragma.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pragma.c,v
retrieving revision 1.60
diff -p -r1.60 c-pragma.c
*** c-pragma.c	17 Jul 2003 20:12:14 -0000	1.60
--- c-pragma.c	19 Jul 2003 13:09:11 -0000
*************** apply_pragma_weak (tree decl, tree value
*** 275,281 ****
    if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
        && !DECL_WEAK (decl) /* don't complain about a redundant #pragma */
        && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
!     warning_with_decl (decl, "applying #pragma weak `%s' after first use results in unspecified behavior");
  
    declare_weak (decl);
  }
--- 275,282 ----
    if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
        && !DECL_WEAK (decl) /* don't complain about a redundant #pragma */
        && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
!     warning ("%Happlying #pragma weak '%D' after first use results "
!              "in unspecified behavior", &DECL_SOURCE_LOCATION (decl), decl);
  
    declare_weak (decl);
  }
Index: toplev.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.h,v
retrieving revision 1.108
diff -p -r1.108 toplev.h
*** toplev.h	11 Jul 2003 08:33:15 -0000	1.108
--- toplev.h	19 Jul 2003 13:09:11 -0000
*************** extern void _fatal_insn (const char *, r
*** 55,61 ****
  #endif
  extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
       ATTRIBUTE_NORETURN;
! extern void warning (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
  extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
  extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
       ATTRIBUTE_NORETURN;
--- 55,61 ----
  #endif
  extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
       ATTRIBUTE_NORETURN;
! extern void warning (const char *, ...);
  extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
  extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
       ATTRIBUTE_NORETURN;



More information about the Gcc-patches mailing list