This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static const double pi = 3.1415;
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: gcc at gcc dot gnu dot org
- Date: 19 Feb 2003 08:38:00 +0200
- Subject: Re: static const double pi = 3.1415;
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <43620000.1045552786@warlock.codesourcery.com>
mark at codesourcery dot com (Mark Mitchell) wrote on 17.02.03 in <43620000 dot 1045552786 at warlock dot codesourcery dot com>:
> --On Saturday, February 15, 2003 04:13:24 PM -0800 Mike Stump
> <mrs at apple dot com> wrote:
>
> > Thoughts? I have a patch to do this, if we like the general idea.
>
> I don't believe this was ever a GNU language feature as such; it was never
> documented as an extension to my knowledge. It was just one of many, many
> places where we allowed more code to compile than we should have.
>
> If people really feel that we need to add this back in, we can do that with
> -fpermissive -- but the only exception we should make is for floating-point
> types, not aggregates, etc. That latter case cannot really be made to work
> reliably without major work.
Note I'm not arguing for or against any particular extension here.
That said - what would be hard about allowing to initialize PODs with
constant expressions? Or about any static member variables, for that
matter - I assume there must be a reason to disallow for what are in
effect global variables inside a class namespace what is allowed for
global variables outside a class namespace, but it is certainly not
obvious to me what reason that would be. (And it's certainly an ugly
wart.)
MfG Kai