This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: misusing placement new OR possible cxx bug
- From: Andreas Schwab <schwab at suse dot de>
- To: Ralovich, Kristóf <kristof dot ralovich at gmail dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Oct 2008 18:49:05 +0200
- Subject: Re: misusing placement new OR possible cxx bug
- References: <5712ce4f0810130910n579eb749ke5d2a1b4b8ace5bc@mail.gmail.com>
"Ralovich, Kristóf" <kristof.ralovich@gmail.com> writes:
> ----------------------------------------
>
> int
> main(int argc, char** argv)
> {
> char* d = new char[256, 256];
> return 0;
> }
>
> ----------------------------------------
>
> Is this the use of 'placement new' in weird syntax I didn't know
> before, or is this code wrong and accidentally accepted by gcc? In the
> former case, please correct me and sorry for the noise!
$ gcc -Wunused-value -c new.cc
new.cc: In function 'int main(int, char**)':
new.cc:4: warning: left-hand operand of comma has no effect
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."