J
Joachim Schmitz
Hi folks
Is it legal for a C compiler that claims to be conforming to the standard
(c89) to issue an error on the following:
char *foo(const char *s)
{
const char *s;
for (s = src; *s && !(((unsigned char)s[0]) & 0x80); s++)
if (*s == c)
return s;
....
}
I get 2 errors when compiling this:
error(212): return value type does not match the function type
error(611): a value of type "const char *" cannot be assigned to an entity
of type "char *"
I'd understand a warning, but an error?
Bye, Jojo
Is it legal for a C compiler that claims to be conforming to the standard
(c89) to issue an error on the following:
char *foo(const char *s)
{
const char *s;
for (s = src; *s && !(((unsigned char)s[0]) & 0x80); s++)
if (*s == c)
return s;
....
}
I get 2 errors when compiling this:
error(212): return value type does not match the function type
error(611): a value of type "const char *" cannot be assigned to an entity
of type "char *"
I'd understand a warning, but an error?
Bye, Jojo