ref: c7315dfa1117bafcb193d4fbd9cdaa27d08e932d
parent: a31573bf6a292f30bd578285aff5da9652931579
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Oct 31 17:13:19 EDT 2013
Fix struct field declaration struct fields cannot have storage or qualifiers specifiers, and it causes they can be defined without explicit type.
--- a/decl.c
+++ b/decl.c
@@ -220,12 +220,15 @@
if (!tp->defined) {
if (!store->defined &&
!qlf->defined &&
- curctx != CTX_OUTER ) {
+ curctx != CTX_OUTER &&
+ nested_tags == 0) {
return false;
}
warn(options.implicit,
"type defaults to 'int' in declaration");
}
+ if (nested_tags > 0 && (qlf->defined || store->defined))
+ error("type qualifer or store specifier in field declaration");
if (!tp->c_signed && !tp->c_unsigned) {
switch (tp->type) {
case CHAR:
--
⑨