]> granicus.if.org Git - flex/commitdiff
Fixed declaration mismatch in yy_fatal_error.
authorTobias Klauser <tklauser@distanz.ch>
Wed, 27 Jan 2016 12:58:08 +0000 (13:58 +0100)
committerWill Estes <westes575@gmail.com>
Wed, 27 Jan 2016 22:01:14 +0000 (17:01 -0500)
The prototype declares yy_fatal_error parameter as "const char msg[]"
while the definition uses "const char* msg" (introduced by commit
e9d5fc713f61b) which causes the sparse static checkers to produce an
error.

Fix this by adjusting the definition to use "const char* msg" as well.
Also change the C++ version accordingly so it matches the declaration in
FlexLexer.hpp.

src/flex.skl

index 2daaefba98ecacbf7d4ccba7154011ccbe95f124..0374ecd21727c3f0747fa379103d41ff3218aeb4 100644 (file)
@@ -740,7 +740,7 @@ static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
 #if defined(__GNUC__) && __GNUC__ >= 3
 __attribute__((__noreturn__))
 #endif
-static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG );
+static void yy_fatal_error M4_YY_PARAMS( yyconst char* msg M4_YY_PROTO_LAST_ARG );
 ]])
 
 %endif
@@ -2558,7 +2558,7 @@ static void yy_fatal_error YYFARGS1(yyconst char*, msg)
 }
 %endif
 %if-c++-only
-void yyFlexLexer::LexerError( yyconst char msg[] )
+void yyFlexLexer::LexerError( yyconst char* msg )
 {
     M4_YY_DECL_GUTS_VAR();
        std::cerr << msg << std::endl;