nvim:viml: Fix enum declaration of ExprParserFlags

Instead of declaring an enum, this creates a global variable. As gcc10
uses -fno-common by default, global variables declared with the same
name more than once is not allowed anymore revealing this issue.

Each time this header is included, we define the enum name as a global
variable.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
This commit is contained in:
Andreas Schneider
2020-02-17 17:17:37 +01:00
parent ebcde1de42
commit b87b4a6147

View File

@@ -326,7 +326,7 @@ struct expr_ast_node {
} data;
};
enum {
enum ExprParserFlags {
/// Allow multiple expressions in a row: e.g. for :echo
///
/// Parser will still parse only one of them though.
@@ -345,7 +345,7 @@ enum {
// viml_expressions_parser.c, nvim_parse_expression() flags parsing
// alongside with its documentation and flag sets in check_parsing()
// function in expressions parser functional and unit tests.
} ExprParserFlags;
};
/// AST error definition
typedef struct {