From e78ea8b28064181d9081e7ff0143830c4ec37d7f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 6 Aug 2015 15:34:43 +0100 Subject: Enable warnings to be enabled and generated for unimplemented elements --- src/nsgenbind.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/nsgenbind.c') diff --git a/src/nsgenbind.c b/src/nsgenbind.c index 65feedd..173f23d 100644 --- a/src/nsgenbind.c +++ b/src/nsgenbind.c @@ -58,7 +58,22 @@ static struct options* process_cmdline(int argc, char **argv) break; case 'W': - options->warnings = 1; /* warning flags */ + if ((optarg == NULL) || + (strcmp(optarg, "all") == 0)) { + /* all warnings */ + options->warnings |= WARNING_ALL; + } else if (strcmp(optarg, "unimplemented") == 0) { + options->warnings |= WARNING_UNIMPLEMENTED; + } else if (strcmp(optarg, "duplicated") == 0) { + options->warnings |= WARNING_DUPLICATED; + } else { + fprintf(stderr, + "Unknown warning option \"%s\" valid options are: all, unimplemented\n", + optarg); + free(options); + return NULL; + + } break; default: /* '?' */ @@ -67,7 +82,6 @@ static struct options* process_cmdline(int argc, char **argv) argv[0]); free(options); return NULL; - } } -- cgit v1.2.3