diff mbox

[2/6] checkpolicy: add noreturn attribute to usage()

Message ID 20170305171305.23170-2-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss March 5, 2017, 5:13 p.m. UTC
While at it, make usage() static and mark its argument as const.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 checkpolicy/checkmodule.c | 2 +-
 checkpolicy/checkpolicy.c | 2 +-
 checkpolicy/test/dismod.c | 2 +-
 checkpolicy/test/dispol.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/checkpolicy/checkmodule.c b/checkpolicy/checkmodule.c
index 53cc5a04c9a4..46ce258fb832 100644
--- a/checkpolicy/checkmodule.c
+++ b/checkpolicy/checkmodule.c
@@ -124,7 +124,7 @@  static int write_binary_policy(policydb_t * p, FILE *outfp)
 	return policydb_write(p, &pf);
 }
 
-static void usage(char *progname)
+static __attribute__((__noreturn__)) void usage(const char *progname)
 {
 	printf("usage:  %s [-h] [-V] [-b] [-C] [-U handle_unknown] [-m] [-M] [-o FILE] [INPUT]\n", progname);
 	printf("Build base and policy modules.\n");
diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c
index c82f6f409271..b98bfcd1f169 100644
--- a/checkpolicy/checkpolicy.c
+++ b/checkpolicy/checkpolicy.c
@@ -102,7 +102,7 @@  static const char *binfile = "policy";
 
 unsigned int policyvers = POLICYDB_VERSION_MAX;
 
-void usage(char *progname)
+static __attribute__((__noreturn__)) void usage(const char *progname)
 {
 	printf
 	    ("usage:  %s [-b] [-C] [-d] [-U handle_unknown (allow,deny,reject)] [-M]"
diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c
index 08b039dc1de0..aac13e17fed3 100644
--- a/checkpolicy/test/dismod.c
+++ b/checkpolicy/test/dismod.c
@@ -65,7 +65,7 @@  static const char *symbol_labels[9] = {
 	"levels ", "cats   ", "attribs"
 };
 
-void usage(const char *progname)
+static __attribute__((__noreturn__)) void usage(const char *progname)
 {
 	printf("usage:  %s binary_pol_file\n\n", progname);
 	exit(1);
diff --git a/checkpolicy/test/dispol.c b/checkpolicy/test/dispol.c
index d91fafdb0e1c..ee0f5f643482 100644
--- a/checkpolicy/test/dispol.c
+++ b/checkpolicy/test/dispol.c
@@ -36,7 +36,7 @@ 
 
 static policydb_t policydb;
 
-void usage(const char *progname)
+static __attribute__((__noreturn__)) void usage(const char *progname)
 {
 	printf("usage:  %s binary_pol_file\n\n", progname);
 	exit(1);