This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a Bug or shall this so?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Christian Klahn <christian at warchris dot dyndns dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 5 May 2011 22:09:46 +0100
- Subject: Re: Is this a Bug or shall this so?
- References: <4DC2FE05.1090706@warchris.dyndns.org>
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.