Skip to content

Commit 8e1661b

Browse files
committed
instrument functions: Reduce the scope of a variable
Fix the cppcheck warning: instrument-functions.c:77:15: warning: The scope of the variable 'instrument_type' can be reduced. [variableScope]
1 parent b016347 commit 8e1661b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

instrument-functions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
7474
static long symcount;
7575
static asection *text;
7676
static bfd_vma vma;
77-
static char *instrument_type;
7877
static int instrument_set;
7978
static int instrument_off;
8079
static int instrument_global;
8180
int i;
8281

8382
if (!instrument_set) {
83+
static char *instrument_type;
84+
8485
/* Get the configuration environment variable INSTRUMENT value if any */
8586
instrument_type = getenv("INSTRUMENT");
8687
/* unset or set to an empty string ? */

0 commit comments

Comments
 (0)