Oops. Using %{ %} in the rules (rather than definitions) section of a
lex file has undefined behaviour. In fact it ends up including the stuff within the definition of the yylex() function, leading to strange warnings on gcc-3.4 and compile errors with gcc 4.
This commit is contained in:
@@ -29,8 +29,6 @@ WS [ \t\n]
|
|||||||
|
|
||||||
REFCHAR ({PROPCHAR}|{UNITCHAR}|[/@])
|
REFCHAR ({PROPCHAR}|{UNITCHAR}|[/@])
|
||||||
|
|
||||||
%%
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
|
|
||||||
@@ -46,6 +44,8 @@ REFCHAR ({PROPCHAR}|{UNITCHAR}|[/@])
|
|||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%%
|
||||||
|
|
||||||
\"[^"]*\" {
|
\"[^"]*\" {
|
||||||
DPRINT("String: %s\n", yytext);
|
DPRINT("String: %s\n", yytext);
|
||||||
yylval.data = data_copy_escape_string(yytext+1,
|
yylval.data = data_copy_escape_string(yytext+1,
|
||||||
|
|||||||
Reference in New Issue
Block a user