This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: misusing placement new OR possible cxx bug


"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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]