From 6bb5a7af6621e8c020a8856466079c3a10d21602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 6 Jun 2018 13:46:50 +0200 Subject: [PATCH] lemon: Make it build with __clang_analyzer__ defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The static function handleswitch() is not compiled with __clang_analyzer__ defined, but it's used in OptInit() without any checks. Change to have an empty implementation for __clang_analyzer__. Change-Id: I73da2042ec64fdfa6910c02c059d36db491dc538 Reviewed-on: https://code.wireshark.org/review/28059 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo Reviewed-by: Anders Broman --- tools/lemon/lemon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c index 35ffe8ce91..faa8530870 100644 --- a/tools/lemon/lemon.c +++ b/tools/lemon/lemon.c @@ -2058,18 +2058,18 @@ static int handleflags(int i, FILE *err) return errcnt; } -#ifndef __clang_analyzer__ /* ** Process a command line switch which has an argument. */ static int handleswitch(int i, FILE *err) { + int errcnt = 0; +#ifndef __clang_analyzer__ int lv = 0; double dv = 0.0; char *sv = 0, *end; char *cp; int j; - int errcnt = 0; cp = strchr(argv[i],'='); assert( cp!=0 ); *cp = 0; @@ -2146,9 +2146,9 @@ static int handleswitch(int i, FILE *err) break; } } +#endif return errcnt; } -#endif int OptInit(char **a, struct s_options *o, FILE *err) {