We define the YY_NO_INPUT macro to avoid one needless function being
generated.
for the other needless functions, (yyunput and yy_top_state), we add a
new UNREACHABLE start condition and call these functions from an
action there. This doesn't change functionality at all, (since we
never enter the UNREACHABLE start condition), but makes the compiler
stop complaining about these two functions being defined but not used.
int glcpp_get_column (yyscan_t yyscanner);
void glcpp_set_column (int column_no , yyscan_t yyscanner);
+#define YY_NO_INPUT
+
#define YY_USER_ACTION \
do { \
yylloc->source = 0; \
%option prefix="glcpp_"
%option stack
-%x DONE COMMENT
+%x DONE COMMENT UNREACHABLE
SPACE [[:space:]]
NONSPACE [^[:space:]]
return NEWLINE;
}
+ /* We don't actually use the UNREACHABLE start condition. We
+ only have this action here so that we can pretend to call some
+ generated functions, (to avoid "defined but not used"
+ warnings. */
+<UNREACHABLE>. {
+ unput('.');
+ yy_top_state(yyextra);
+}
+
%%
void