All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Göttsche" <cgoettsche@seltendoof.de>
To: selinux@vger.kernel.org
Cc: "Christian Göttsche" <cgzones@googlemail.com>
Subject: [PATCH 1/6] checkpolicy: include <ctype.h> for isprint(3)
Date: Tue,  2 Apr 2024 17:29:20 +0200	[thread overview]
Message-ID: <20240402152925.99781-1-cgoettsche@seltendoof.de> (raw)

From: Christian Göttsche <cgzones@googlemail.com>

Include the necessary header for isprint(3) to avoid an implicit
function declaration:

    policy_scan.l: In function ‘yyerror’:
    policy_scan.l:342:13: warning: implicit declaration of function ‘isprint’ [-Wimplicit-function-declaration]
      342 |         if (isprint((unsigned char)yytext[0])) {
          |             ^~~~~~~
    policy_scan.l:36:1: note: include ‘<ctype.h>’ or provide a declaration of ‘isprint’
       35 | #include "y.tab.h"
      +++ |+#include <ctype.h>
       36 | #endif

This does not currently break the build cause -Werror is stripped for
the parsing code to avoid breakage on old flex/bison versions that might
not generate warning free code.

Fixes: 39b3cc51350a ("checkpolicy: handle unprintable token")
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 checkpolicy/policy_scan.l | 1 +
 1 file changed, 1 insertion(+)

diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l
index d7cf2896..62f28c11 100644
--- a/checkpolicy/policy_scan.l
+++ b/checkpolicy/policy_scan.l
@@ -22,6 +22,7 @@
 
 %{
 #include <sys/types.h>
+#include <ctype.h>
 #include <limits.h>
 #include <stdint.h>
 #include <string.h>
-- 
2.43.0


             reply	other threads:[~2024-04-02 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 15:29 Christian Göttsche [this message]
2024-04-02 15:29 ` [PATCH 2/6] checkpolicy/fuzz: override YY_FATAL_ERROR Christian Göttsche
2024-04-02 15:29 ` [PATCH 3/6] libsepol: validate access vector permissions Christian Göttsche
2024-04-02 15:29 ` [PATCH 4/6] checkpolicy: drop never read member Christian Göttsche
2024-04-02 15:29 ` [PATCH 5/6] checkpolicy: drop union stack_item_u Christian Göttsche
2024-04-02 15:29 ` [PATCH 6/6] checkpolicy: free complete role_allow_rule on error Christian Göttsche
2024-04-03 19:35 ` [PATCH 1/6] checkpolicy: include <ctype.h> for isprint(3) James Carter
2024-04-04 16:22   ` James Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240402152925.99781-1-cgoettsche@seltendoof.de \
    --to=cgoettsche@seltendoof.de \
    --cc=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.