pointer reference comparing with int in gcc 4.1.2
me22
me22.ca@gmail.com
Tue Dec 16 03:48:00 GMT 2008
On Mon, Dec 15, 2008 at 22:30, yangch <yangchanghua@gmail.com> wrote:
>
> void f(str_t const &s)
> {
> printf("sizeof s:%d\n",sizeof(s));
> if(s)
> printf("%s\n",s);
> }
>
> test.cc: In function 'void f(const char (&)[10])':
> test.cc:9: error: invalid operands of types 'const char (&)[10]' and 'int'
> to binary 'operator!='
>
I think it's just a bug in 4.1.2. It compiles fine in 4.3.1.
HTH,
~ Scott
P.S. Rather odd that it talks about != there...
More information about the Gcc-help
mailing list