Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-25 Thread Gabriel Dos Reis
On Sun, May 24, 2009 at 11:13 PM, Ian Lance Taylor wrote: > Joern Rennecke writes: > >> Quoting Ian Lance Taylor : >>> Joern Rennecke writes:     * config/sh/sh.c (sh_attribute_table): Use extern in forward     declaration. Common issue with declaring/defining const variables in C

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-25 Thread Gabriel Dos Reis
On Sun, May 24, 2009 at 10:23 PM, Joern Rennecke wrote: > Quoting Ian Lance Taylor : >> >> Joern Rennecke writes: >>> >>>        * config/sh/sh.c (sh_attribute_table): Use extern in forward >>>        declaration. >>> Common issue with declaring/defining const variables in C++. >> >> I've been do

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Ian Lance Taylor
Joern Rennecke writes: > Quoting Ian Lance Taylor : > >> Joern Rennecke writes: >>> ... Could we use a #define >>> for this? E.g. put in system.h >>> #ifdef __cplusplus >>> #define CONST_VAR_DECL extern const >>> #else >>> #define CONST_VAR_DECL const >>> #endif >> >> Yes, that is certainly t

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Joern Rennecke
Quoting Ian Lance Taylor : Joern Rennecke writes: ... Could we use a #define for this? E.g. put in system.h #ifdef __cplusplus #define CONST_VAR_DECL extern const #else #define CONST_VAR_DECL const #endif Yes, that is certainly the way to go if it is in fact not safe to use "extern const

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Ian Lance Taylor
Joern Rennecke writes: > Quoting Ian Lance Taylor : >> Joern Rennecke writes: >>> * config/sh/sh.c (sh_attribute_table): Use extern in forward >>> declaration. >>> Common issue with declaring/defining const variables in C++. >> >> I've been doing this as >> >> #ifdef __cplusplus >> exter

extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Joern Rennecke
Quoting Ian Lance Taylor : Joern Rennecke writes: * config/sh/sh.c (sh_attribute_table): Use extern in forward declaration. Common issue with declaring/defining const variables in C++. I've been doing this as #ifdef __cplusplus extern #endif These #ifdefs sprinkled over the