diff options
-rw-r--r-- | src/duk-libdom.c | 11 | ||||
-rw-r--r-- | src/nsgenbind.c | 18 | ||||
-rw-r--r-- | src/options.h | 2 |
3 files changed, 28 insertions, 3 deletions
diff --git a/src/duk-libdom.c b/src/duk-libdom.c index b01ac4e..a2d65af 100644 --- a/src/duk-libdom.c +++ b/src/duk-libdom.c @@ -954,6 +954,9 @@ output_interface_operation(FILE* outf, if (cdatac == 0) { /* no implementation so generate default */ + WARN(WARNING_UNIMPLEMENTED, + "Unimplemented: method %s::%s();", + interfacee->name, operatione->name); fprintf(outf,"\treturn 0;\n"); } @@ -1009,6 +1012,10 @@ output_interface_attribute(FILE* outf, cdatac = output_cdata(outf, atributee->getter, GENBIND_NODE_TYPE_CDATA); if (cdatac == 0) { + WARN(WARNING_UNIMPLEMENTED, + "Unimplemented: getter %s::%s();", + interfacee->name, atributee->name); + /* no implementation so generate default */ fprintf(outf,"\treturn 0;\n"); } @@ -1031,6 +1038,10 @@ output_interface_attribute(FILE* outf, cdatac = output_cdata(outf, atributee->setter, GENBIND_NODE_TYPE_CDATA); if (cdatac == 0) { + WARN(WARNING_UNIMPLEMENTED, + "Unimplemented: setter %s::%s();", + interfacee->name, atributee->name); + /* no implementation so generate default */ fprintf(outf,"\treturn 0;\n"); } 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; - } } diff --git a/src/options.h b/src/options.h index 85f107e..02674b7 100644 --- a/src/options.h +++ b/src/options.h @@ -32,7 +32,7 @@ enum opt_warnings { #define WARN(flags, msg, args...) do { \ if ((options->warnings & flags) != 0) { \ - fprintf(stderr, "%s: warning:"msg"\n", __func__, ## args); \ + fprintf(stderr, "%s: warning: "msg"\n", __func__, ## args); \ } \ } while(0) |