opts_set(opts.warn, WARN_UNREACHABLE_CODE, true);
opts_set(opts.warn, WARN_CPP, true);
opts_set(opts.warn, WARN_UNKNOWN_ATTRIBUTE, true);
+ opts_set(opts.warn, WARN_RESERVED_NAMES, true);
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);
opts_set(opts.flags, FTEPP, false);
GMQCC_DEFINE_FLAG(BAIL_ON_WERROR)
GMQCC_DEFINE_FLAG(LOOP_LABELS)
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
+ GMQCC_DEFINE_FLAG(PERMISSIVE)
#endif
/* warning flags */
GMQCC_DEFINE_FLAG(UNREACHABLE_CODE)
GMQCC_DEFINE_FLAG(CPP)
GMQCC_DEFINE_FLAG(UNKNOWN_ATTRIBUTE)
+ GMQCC_DEFINE_FLAG(RESERVED_NAMES)
#endif
#ifdef GMQCC_TYPE_OPTIMIZATIONS
* Also: if there was a prototype, `var` will be deleted and set to `proto` which
* is then filled with the previous definition and the parameter-names replaced.
*/
+ if (!strcmp(var->name, "nil")) {
+ if (OPTS_FLAG(UNTYPED_NIL)) {
+ if (!localblock || !OPTS_FLAG(PERMISSIVE))
+ parseerror(parser, "name `nil` not allowed (try -fpermissive)");
+ } else
+ (void)!parsewarning(parser, WARN_RESERVED_NAMES, "variable name `nil` is reserved");
+ }
if (!localblock) {
/* Deal with end_sys_ vars */
was_end = false;