diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-17 09:18:31 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-17 09:18:31 -0700 |
commit | 8c0dfb819569baf3c388bf9915fea1d332a29908 (patch) | |
tree | 2767baaae47b1afffb7d3b213c039d7712fed00e | |
parent | 0db44a83b2bb9b74a266d41e8b7d2731713d7eac (diff) |
Fix -Wshadow warnings
imake.c: In function ‘FindImakefile’:
imake.c:662:27: warning: declaration of ‘Imakefile’ shadows a global declaration [-Wshadow]
FindImakefile(const char *Imakefile)
^~~~~~~~~
imake.c:319:13: note: shadowed declaration is here
const char *Imakefile = NULL;
^~~~~~~~~
imake.c: In function ‘define_os_defaults’:
imake.c:1636:9: warning: declaration of ‘name’ shadows a previous local [-Wshadow]
char name[PATH_MAX];
^~~~
imake.c:1430:18: note: shadowed declaration is here
struct utsname *name = NULL;
^~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | imake.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -659,21 +659,21 @@ SetOpts(int argc, char **argv) } const char * -FindImakefile(const char *Imakefile) +FindImakefile(const char *filename) { - if (Imakefile) { - if (access(Imakefile, R_OK) < 0) - LogFatal("Cannot find %s.", Imakefile); + if (filename) { + if (access(filename, R_OK) < 0) + LogFatal("Cannot find %s.", filename); } else { if (access("Imakefile", R_OK) < 0) { if (access("imakefile", R_OK) < 0) LogFatal("No description file."); else - Imakefile = "imakefile"; + filename = "imakefile"; } else - Imakefile = "Imakefile"; + filename = "Imakefile"; } - return(Imakefile); + return(filename); } static void _X_ATTRIBUTE_PRINTF(1, 0) @@ -1633,12 +1633,12 @@ define_os_defaults(FILE *inFile) if (gnu_c) # endif { - char name[PATH_MAX]; - if (get_gcc(name)) { - get_gcc_version (inFile,name); + char gcc_name[PATH_MAX]; + if (get_gcc(gcc_name)) { + get_gcc_version (inFile, gcc_name); # if defined CROSSCOMPILE if (sys != emx) - get_gcc_incdir(inFile,name); + get_gcc_incdir(inFile, gcc_name); # endif } } |