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>
Tue, 10 Mar 2020 02:02:26 +0000 (22:02 -0400)
commit52dc69b2dc349a43f108a9926b0794ee6b6ec4c3
treed3b02483a278a360f50f547ad7b3d981f2678e0a
parent897c9a64fafa0535f09d01234507a817e157590d
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.024703 seconds and 4 git commands to generate.