- not append one.
-
- FIXME: Bison should warn if a semicolon seems to be necessary
- here, and should omit the semicolon if it seems unnecessary
- (e.g., after ';', '{', or '}', each followed by comments or
- white space). Such a warning shouldn't depend on --yacc; it
- should depend on a new --pedantic option, which would cause
- Bison to warn if it detects an extension to POSIX. --pedantic
- should also diagnose other Bison extensions like %yacc.
- Perhaps there should also be a GCC-style --pedantic-errors
- option, so that such warnings are diagnosed as errors. */
- if (outer_brace && ! yacc_flag)
- obstack_1grow (&obstack_for_string, ';');
+ not append one. */
+ if (outer_brace && !yacc_flag && language_prio == default_prio
+ && skeleton_prio == default_prio && need_semicolon && ! in_cpp)
+ {
+ warn_at (*loc, _("a `;' might be needed at the end of action code"));
+ warn_at (*loc, _("future versions of Bison will not add the `;'"));
+ obstack_1grow (&obstack_for_string, ';');
+ }