public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joe Buck <jbuck@synopsys.com>
To: josti@mscs.dal.ca (JC Loredo-Osti)
Cc: egcs-bugs@cygnus.com, egcs@cygnus.com
Subject: Re: is it a bug?
Date: Thu, 30 Apr 1998 15:45:00 -0000	[thread overview]
Message-ID: <199804301947.MAA23991@atrus.synopsys.com> (raw)
In-Reply-To: <Pine.GSO.3.96.980430141027.22638A-100000@mscs>

> Both, egcs-19980418 and egcs-19980425, complain about the follwing code

> main(){
> 	double *p = new double[3](0);
> }

That's because it isn't C++.  g++ used to have an extension that allowed
the use of constructor arguments with arrays, but it hasn't been
maintained and the egcs team wants to encourage people to program in C++,
not a strange dialect called g++.  So you are likely to see the more
questionable GNU extensions eliminated.

If you need to do something like this (an array of values each of which
is initialized using constructor arguments), use vector<double> instead:

	vector<double> p(3,0.0);

(saying p(3,0) here will result in trouble -- yet another problem).

  reply	other threads:[~1998-04-30 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-30 10:25 JC Loredo-Osti
1998-04-30 15:45 ` Joe Buck [this message]
1998-04-30 13:20   ` JC Loredo-Osti
     [not found] <199712081205.NAA25992@vbormc.vbo.dec.com>
     [not found] ` <orvhwzzkd1.fsf.cygnus.egcs.bugs@grupiara.dcc.unicamp.br>
1997-12-08 22:22   ` Is it a bug ? Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199804301947.MAA23991@atrus.synopsys.com \
    --to=jbuck@synopsys.com \
    --cc=egcs-bugs@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=josti@mscs.dal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).