public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Is this a Bug or shall this so?
@ 2011-05-05 19:44 Christian Klahn
  2011-05-05 21:10 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Klahn @ 2011-05-05 19:44 UTC (permalink / raw)
  To: gcc-help

Hello

I have discovered a strange something.

This Code compiled witheout Errors and gives "AB" to the Terminal:
------------------------------------------------
#include <iostream>

int main()
{
     char ch[] = "AB\n";
     std::cout << ch;
     '\n';
     return 0;
}
------------------------------------------------
Is the Code in line seven valid or is that a Bug in gcc/g++?


Christian Klahn

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is this a Bug or shall this so?
  2011-05-05 19:44 Is this a Bug or shall this so? Christian Klahn
@ 2011-05-05 21:10 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2011-05-05 21:10 UTC (permalink / raw)
  To: Christian Klahn; +Cc: gcc-help

On 5 May 2011 20:44, Christian Klahn wrote:
> Hello
>
> I have discovered a strange something.
>
> This Code compiled witheout Errors and gives "AB" to the Terminal:
> ------------------------------------------------
> #include <iostream>
>
> int main()
> {
>    char ch[] = "AB\n";
>    std::cout << ch;
>    '\n';
>    return 0;
> }
> ------------------------------------------------
> Is the Code in line seven valid or is that a Bug in gcc/g++?

The code is valid, although the expression on line 7 is useless and
doesn't do anything.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-05 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-05 19:44 Is this a Bug or shall this so? Christian Klahn
2011-05-05 21:10 ` Jonathan Wakely

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