diff mbox series

[1/5] libsepol/cil: declare file local function pointer static

Message ID 20220408131054.7957-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit 6bc2980545d9
Headers show
Series [1/5] libsepol/cil: declare file local function pointer static | expand

Commit Message

Christian Göttsche April 8, 2022, 1:10 p.m. UTC
../cil/src/cil_log.c:45:8: warning: no previous extern declaration for non-static variable 'cil_log_handler' [-Wmissing-variable-declarations]
    void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
           ^

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsepol/cil/src/cil_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Carter April 12, 2022, 1:03 p.m. UTC | #1
On Fri, Apr 8, 2022 at 9:37 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
>     ../cil/src/cil_log.c:45:8: warning: no previous extern declaration for non-static variable 'cil_log_handler' [-Wmissing-variable-declarations]
>     void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
>            ^
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

For these 5 patches:
Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  libsepol/cil/src/cil_log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libsepol/cil/src/cil_log.c b/libsepol/cil/src/cil_log.c
> index e45c58fc..f4c6e415 100644
> --- a/libsepol/cil/src/cil_log.c
> +++ b/libsepol/cil/src/cil_log.c
> @@ -42,7 +42,7 @@ static void cil_default_log_handler(__attribute__((unused)) int lvl, const char
>         fprintf(stderr, "%s", msg);
>  }
>
> -void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
> +static void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
>
>  void cil_set_log_handler(void (*handler)(int lvl, const char *msg))
>  {
> --
> 2.35.1
>
James Carter April 12, 2022, 6:02 p.m. UTC | #2
On Tue, Apr 12, 2022 at 9:03 AM James Carter <jwcart2@gmail.com> wrote:
>
> On Fri, Apr 8, 2022 at 9:37 AM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> >     ../cil/src/cil_log.c:45:8: warning: no previous extern declaration for non-static variable 'cil_log_handler' [-Wmissing-variable-declarations]
> >     void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
> >            ^
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> For these 5 patches:
> Acked-by: James Carter <jwcart2@gmail.com>
>

These 5 patches have been merged.
Thanks,
Jim

> > ---
> >  libsepol/cil/src/cil_log.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libsepol/cil/src/cil_log.c b/libsepol/cil/src/cil_log.c
> > index e45c58fc..f4c6e415 100644
> > --- a/libsepol/cil/src/cil_log.c
> > +++ b/libsepol/cil/src/cil_log.c
> > @@ -42,7 +42,7 @@ static void cil_default_log_handler(__attribute__((unused)) int lvl, const char
> >         fprintf(stderr, "%s", msg);
> >  }
> >
> > -void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
> > +static void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
> >
> >  void cil_set_log_handler(void (*handler)(int lvl, const char *msg))
> >  {
> > --
> > 2.35.1
> >
diff mbox series

Patch

diff --git a/libsepol/cil/src/cil_log.c b/libsepol/cil/src/cil_log.c
index e45c58fc..f4c6e415 100644
--- a/libsepol/cil/src/cil_log.c
+++ b/libsepol/cil/src/cil_log.c
@@ -42,7 +42,7 @@  static void cil_default_log_handler(__attribute__((unused)) int lvl, const char
 	fprintf(stderr, "%s", msg);
 }
 
-void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
+static void (*cil_log_handler)(int lvl, const char *msg) = &cil_default_log_handler;
 
 void cil_set_log_handler(void (*handler)(int lvl, const char *msg))
 {