[1676] in Athena Bugs
(RTPC) Version 6.0R: hc
daemon@ATHENA.MIT.EDU (qjb@ATHENA.MIT.EDU)
Thu Jan 19 14:23:29 1989
From: <qjb@ATHENA.MIT.EDU>
Date: Thu, 19 Jan 89 14:22:40 EST
To: bugs@ATHENA.MIT.EDU
System type, version: (RTPC) Version 6.0R
System name: soup
What's wrong:
hc generates an incorrect error message when an attempt is made to
make an assignment to a character array:
% cat > a.c
main()
{
char *a;
char b[500];
a = "This is a test.";
b = "This is a test.";
}
% cc -c a.c
E "a.c",L7/C5: Variable required.
Object module not generated.
1 user error 1 unprinted warning
Exit 1 cc -c a.c
% cat >! a.c
main()
{
char *a;
char b[500];
a = "This is a test.";
strcpy(b, "This is a test.");
}
% cc -c a.c
w "a.c",L3/C11: a: Variable is set but is never referenced.
What should have happened:
A better error message should be issued. A couple of suggestions are
E "a.c",L7/C5: Assigment to character array illegal.
E "a.c",L7/C5: Character pointer required.