Skip to content

Commit

Permalink
Clean up warnings.
Browse files Browse the repository at this point in the history
Use (void)var to mark var as used, instead of var = var. The
intent of the self assignment was to avoid a warning, but it ends
up invoking a different warning.

Turn off security warnings for a potentially mutable string being
given as the format string to sprintf(). Though only on macosx
unix targets. All of the strings provided are in fact not mutable,
but this fact is hidden from the compiler due to the strings being
extern in a different object file.
  • Loading branch information
madler committed Jun 12, 2019
1 parent 3d61d78 commit d685e65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ int UZ_EXP UzpInput(pG, buf, size, flag)
int flag; /* flag bits (bit 0: no echo) */
{
/* tell picky compilers to shut up about "unused variable" warnings */
pG = pG; buf = buf; flag = flag;
(void)pG; (void)buf; (void)flag;

*size = 0;
return 0;
Expand Down Expand Up @@ -1583,7 +1583,7 @@ int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)

#ifndef REENTRANT
/* tell picky compilers to shut up about "unused variable" warnings */
pG = pG;
(void)pG;
#endif

if (*rcnt == 0) { /* First call for current entry */
Expand Down Expand Up @@ -1614,7 +1614,7 @@ int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)

#else /* !CRYPT */
/* tell picky compilers to shut up about "unused variable" warnings */
pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn;
(void)pG; (void)rcnt; (void)pwbuf; (void)size; (void)zfn; (void)efn;

return IZ_PW_ERROR; /* internal error; function should never get called */
#endif /* ?CRYPT */
Expand Down
4 changes: 2 additions & 2 deletions unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -872,12 +872,12 @@ lynx: unix_make

# Macintosh MacOS X (Unix-compatible enviroment), using standard compiler
macosx: unix_make
$(MAKE) unzips CFLAGS="-O3 -Wall -DBSD" LF2=""
$(MAKE) unzips CFLAGS="-O3 -Wall -DBSD -DZIP64_SUPPORT -Wno-format-security" LF2=""
$(STRIP) $(UNZIPS)

# Macintosh MacOS X (Unix-compatible enviroment), using gcc
macosx_gcc: unix_make
$(MAKE) unzips CC=gcc CFLAGS="-O3 -Wall -DBSD" LF2=""
$(MAKE) unzips CC=gcc CFLAGS="-O3 -Wall -DBSD -DZIP64_SUPPORT Wno-format-security" LF2=""
$(STRIP) $(UNZIPS)

# Minix 1.5 PC for the 386. Invoke as is to use default cc, or as "make
Expand Down

0 comments on commit d685e65

Please sign in to comment.