1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/sh
Johnothan King 733f70e94b
Fix many compiler warnings and remove unused variables (#191)
Most of these changes remove unused variables, functions and labels
to fix -Wunused compiler warnings. Somewhat notable changes:

src/cmd/ksh93/bltins/print.c:
- Removed the unused 'neg' variable.
  Patch from ksh2020: https://github.com/att/ast/pull/725

src/cmd/ksh93/bltins/sleep.c:
- Initialized ns to fix three -Wsometimes-uninitialized warnings.

src/cmd/ksh93/edit/{emacs,vi}.c:
- Adjust strncpy size to fix two -Wstringop-truncation warnings.

src/cmd/ksh93/include/shell.h:
- The NOT_USED macro caused many -Wunused-value warnings,
  so it has been replaced with ksh2020's macro:
  19d0620a

src/cmd/ksh93/sh/expand.c:
- Removed an unnecessary 'ap = ' since 'ap' is never read
  between stakseek and stakfreeze.

src/cmd/ksh93/edit/vi.c: refresh():
- Undef this function's 'w' macro at the end of it to stop it
  potentially interfering with future code changes.

src/cmd/ksh93/sh/nvdisc.c,
src/lib/libast/misc/magic.c,
src/lib/libast/regex/regsubexec.c,
src/lib/libast/sfio/sfpool.c,
src/lib/libast/vmalloc/vmbest.c:
- Fixed some indentation to silence -Wmisleading-indentation
  warnings.

src/lib/libast/include/ast.h:
- For clang, now only suppress hundreds of -Wparentheses warnings
  as well as a few -Wstring-plus-int warnings.
  Clang's -Wparentheses warns about things like
  	if(foo = bar())
  which assigns to foo and checks the assigned value.
  Clang wants us to change this into
  	if((foo = bar()))
  Clang's -Wstring-plus-int warns about things like
  	"string"+x
  where x is an integer, e.g. "string"+3 represents the string
  "ing". Clang wants us to change that to
  	"string"[3]
  The original versions represent a perfectly valid coding style
  that was common in the 1980s and 1990s and is not going to change
  in this historic code base. (gcc does not complain about these.)

Co-authored-by: Martijn Dekker <martijn@inlv.org>
2021-02-22 22:16:32 +00:00
..
args.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
arith.c libast: Update cdt(3): Allow empty strings in (dt)trees 2021-01-28 02:44:52 +00:00
array.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
defs.c test/[: use a shell state bit (re: 7003aba4) 2020-08-30 05:33:59 +01:00
deparse.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
expand.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00
fault.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
fcin.c Fix parsing of multibyte characters 2020-06-12 01:45:17 +02:00
init.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00
io.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00
jobs.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00
lex.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
macro.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
main.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
name.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
nvdisc.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00
nvtree.c Fix disabling SHOPT_FIXEDARRAY (re: 2182ecfa) 2021-02-10 04:48:56 +00:00
nvtype.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
parse.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
path.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
pmain.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shcomp.c resolve/remove USAGE_LICENSE macros; remove repetitive (c) strings 2021-01-31 11:00:49 +00:00
streval.c silence macro redefinition warnings (re: 7003aba4) 2020-06-16 04:51:21 +02:00
string.c Fix garbled output from Ctrl+Alt+V (#135) 2020-09-25 03:37:22 +01:00
subshell.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
suid_exec.c Add lots of checks for out of memory (re: 0ce0b671) 2021-02-21 22:27:28 +00:00
tdump.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
timers.c rm redundant getpid(2) syscalls (re: 9de65210) 2020-09-23 04:19:02 +02:00
trestore.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
waitevent.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
xec.c Fix many compiler warnings and remove unused variables (#191) 2021-02-22 22:16:32 +00:00