This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/67580] New: Improve error message on missing "struct" tag
- From: "chengniansun at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Sep 2015 22:41:41 +0000
- Subject: [Bug c/67580] New: Improve error message on missing "struct" tag
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67580
Bug ID: 67580
Summary: Improve error message on missing "struct" tag
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
Target Milestone: ---
I wonder whether the error message on missing the 'struct' tag can be improved.
IMHO, clang gives a clearer message on how to fix the error. This also applies
to union types.
$: cat t.c
struct S {int s;};
void f(int a) {
S s = {a};
}
$: gcc-trunk -c t.c
t.c: In function âfâ:
t.c:4:3: error: unknown type name âSâ
S s = {a};
^
$: clang-trunk -c t.c
t.c:4:3: error: must use 'struct' tag to refer to type 'S'
S s = {a};
^
struct
1 error generated.
$: