checkpolicy: add missing function declarations

Ideally they should be declared in the corresponding header file, but
the overall include style in the checkpolicy code is quite messy.
Declare them for now in the source file before defining them to silence
related compiler warnings:

    policy_define.c:84:6: error: no previous prototype for function 'init_parser' [-Werror,-Wmissing-prototypes]
    void init_parser(int pass_number)
         ^
    policy_define.c:93:6: error: no previous prototype for function 'yyerror2' [-Werror,-Wmissing-prototypes]
    void yyerror2(const char *fmt, ...)
         ^

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-09-14 14:48:23 +02:00 committed by James Carter
parent 5c376d6db1
commit e6bab7bf45

View File

@ -60,6 +60,10 @@
#include "module_compiler.h"
#include "policy_define.h"
extern void init_parser(int pass_number);
__attribute__ ((format(printf, 1, 2)))
extern void yyerror2(const char *fmt, ...);
policydb_t *policydbp;
queue_t id_queue = 0;
unsigned int pass;
@ -89,7 +93,6 @@ void init_parser(int pass_number)
pass = pass_number;
}
__attribute__ ((format(printf, 1, 2)))
void yyerror2(const char *fmt, ...)
{
va_list ap;