This should essentially be "reset to default behavior" for specified warnings, which is what "enabling" does in WIDL. Increases IDL file format compatibility.
Signed-off-by: Andrew Boyarshin andrew.boyarshin@gmail.com --- tools/widl/parser.l | 2 +- tools/widl/parser.y | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 7e20d30e7f08..1139dba37541 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -655,7 +655,7 @@ int do_warning(char *toggle, warning_list_t *wnum) if(!strcmp(toggle, "disable")) LIST_FOR_EACH_ENTRY(warning, wnum, warning_t, entry) warning_disable(warning->num); - else if(!strcmp(toggle, "enable")) + else if(!strcmp(toggle, "enable") || !strcmp(toggle, "default")) LIST_FOR_EACH_ENTRY(warning, wnum, warning_t, entry) warning_enable(warning->num); else diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 2d527805c148..8cb86c20b44b 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -421,6 +421,14 @@ pragma_warning: tPRAGMA_WARNING '(' aIDENTIFIER ':' warnings ')' if(!result) error_loc("expected "disable" or "enable"\n"); } + | tPRAGMA_WARNING '(' tDEFAULT ':' warnings ')' + { + int result; + $$ = NULL; + result = do_warning("default", $5); + if(!result) + error_loc("expected "default"\n"); + } ;
warnings: