This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcc-in-cxx] Use extern const for C++
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 04 Mar 2009 08:33:48 -0800
- Subject: [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
};