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>
Move to kernel style SPDX license identifiers The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. See https://spdx.org/ids-how for details. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Change-Id: I62e7038e191a061286abcef5550b58f5ee67149d Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Filter: make bitwise and, or, xor higher prio than relational expressions It seems that the usual use-case for bitwise ops are to apply them on values rather than on the result of equality/inequality. Therefore, move away from the C operator precedence order, and ensure bitwise and, or, xor are higher priority than relational expressions (equality and inequality). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Filter: index array, sequences, implement bitwise binary operators Add load expressions, and produce bytecode allowing indexing of array and sequence of integers, as well as bitwise binary operators &, |, ^. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: scanf unbounded input Awaiting a proper cleanup (introducing nscanf), do what we can to validate the scanf input using its utterly broken API. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Librarify filter in liblttng-ctl and hide symbols Create the libfilter.la inside the liblttng-ctl directory so we can statically link with lttng-ctl and the tests. Also hide the dynamic symbol of libfilter used in liblttng-ctl. Signed-off-by: David Goulet <dgoulet@efficios.com>