Fix -Wmissing-declarations warnings in filter-parser.y
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 25 Nov 2019 20:32:19 +0000 (15:32 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Mar 2020 19:19:12 +0000 (15:19 -0400)
commit1a0b02f1166165318db3811383377de67234cdfd
treed3b02483a278a360f50f547ad7b3d981f2678e0a
parentd6d48d194cf54a1d98df386756b375e7aa88bcae
Fix -Wmissing-declarations warnings in filter-parser.y

Make gc_string_append and yyerror static, as they are only used in
this file.

Remove yywrap, apparently, it's not used.  This probably has to do
with the fact that our lexer uses the noyywrap option.

setstring is used by filter-lexer.c (generated from filter-lexer.l),
which has its own local setstring declaration.  This is not very good,
because the prototype of setstring could change in the implementation,
and the users of the function would still compile, but then it would
probably crash inexplicably at runtime.

Instead, put the declaration in filter-parser.h, using a "%code
provides" directive.  That seems to be the intent of "%code provides"
[1]:

    Purpose: This is the best place to write additional definitions and
    declarations that should be provided to other modules.

[1] https://www.gnu.org/software/bison/manual/html_node/_0025code-Summary.html

Change-Id: I04ce69ae9808b72e96bf9e602772f0e5758dfc10
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/filter/filter-lexer.l
src/lib/lttng-ctl/filter/filter-parser.y
This page took 0.025768 seconds and 4 git commands to generate.