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]

[gcc-in-cxx] Use extern const for C++


I came across another case where an explicit "extern const" is needed to
force the C++ compiler to emit a const value.  Committed to gcc-in-cxx
branch.

Ian


2009-03-04  Ian Lance Taylor  <iant@google.com>

	* tree-nomudflap.c (gt_ggc_r_gt_tree_mudflap_h): Declare as extern
	if C++.


Index: tree-nomudflap.c
===================================================================
--- tree-nomudflap.c	(revision 144568)
+++ tree-nomudflap.c	(working copy)
@@ -133,6 +133,9 @@ struct gimple_opt_pass pass_mudflap_2 = 
 We prepare a little dummy struct here.
 */
 
+#ifdef __cplusplus
+extern
+#endif
 const struct ggc_root_tab gt_ggc_r_gt_tree_mudflap_h[] = {
   LAST_GGC_ROOT_TAB
 };

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