Skip to content

Commit

Permalink
kconfig/conf: reduce the scope of `defconfig_file'
Browse files Browse the repository at this point in the history
This variable is not used outside of main() so there is not much reason keeping
it global. Ensure it is initialized as gcc has no way to know that normal
execution path expect only one option switch to be given on the command line
(except when we request help). As a result, we always initialize
`defconfig_file' before using it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
  • Loading branch information
Arnaud Lacombe committed Jul 2, 2011
1 parent 8494453 commit 275744c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ enum input_mode {
oldnoconfig,
} input_mode = oldaskconfig;

char *defconfig_file;

static int indent = 1;
static int valid_stdin = 1;
static int sync_kconfig;
Expand Down Expand Up @@ -462,7 +460,7 @@ static struct option long_opts[] = {
int main(int ac, char **av)
{
int opt;
const char *name;
const char *name, *defconfig_file = NULL /* gcc uninit */;
struct stat tmpstat;

setlocale(LC_ALL, "");
Expand Down

0 comments on commit 275744c

Please sign in to comment.