1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix more compiler warnings, typos and other minor issues (#260)

Many of these changes are minor typo fixes. The other changes
(which are mostly compiler warning fixes) are:

NEWS:
- The --globcasedetect shell option works on older Linux kernels
  when used with FAT32/VFAT file systems, so remove the note about
  it only working with 5.2+ kernels.

src/cmd/ksh93/COMPATIBILITY:
- Update the documentation on function scoping with an addition
  from ksh93v- (this does apply to ksh93u+).

src/cmd/ksh93/edit/emacs.c:
- Check for '_AST_ksh_release', not 'AST_ksh_release'.

src/cmd/INIT/mamake.c,
src/cmd/INIT/ratz.c,
src/cmd/INIT/release.c,
src/cmd/builtin/pty.c:
- Add more uses of UNREACHABLE() and noreturn, this time for the
  build system and pty.

src/cmd/builtin/pty.c,
src/cmd/builtin/array.c,
src/cmd/ksh93/sh/name.c,
src/cmd/ksh93/sh/nvtype.c,
src/cmd/ksh93/sh/suid_exec.c:
- Fix six -Wunused-variable warnings (the name.c nv_arrayptr()
  fixes are also in ksh93v-).
- Remove the unused 'tableval' function to fix a -Wunused-function
  warning.

src/cmd/ksh93/sh/lex.c:
- Remove unused 'SHOPT_DOS' code, which isn't enabled anywhere.
  https://github.com/att/ast/issues/272#issuecomment-354363112

src/cmd/ksh93/bltins/misc.c,
src/cmd/ksh93/bltins/trap.c,
src/cmd/ksh93/bltins/typeset.c:
- Add dictionary generator function declarations for former
  aliases that are now builtins (re: 1fbbeaa1, ef1621c1, 3ba4900e).
- For consistency with the rest of the codebase, use '(void)'
  instead of '()' for print_cpu_times.

src/cmd/ksh93/sh/init.c,
src/lib/libast/path/pathshell.c:
- Move the otherwise unused EXE macro to pathshell() and only
  search for 'sh.exe' on Windows.

src/cmd/ksh93/sh/xec.c,
src/lib/libast/include/ast.h:
- Add an empty definition for inline when compiling with C89.
  This allows the timeval_to_double() function to be inlined.

src/cmd/ksh93/include/shlex.h:
- Remove the unused 'PIPESYM2' macro.

src/cmd/ksh93/tests/pty.sh:
- Add '# err_exit #' to count the regression test added in
  commit 113a9392.

src/lib/libast/disc/sfdcdio.c:
- Move diordwr, dioread, diowrite and dioexcept behind
  '#ifdef F_DIOINFO' to fix one -Wunused-variable warning and
  multiple -Wunused-function warnings (sfdcdio() only uses these
  functions when F_DIOINFO is defined).

src/lib/libast/string/fmtdev.c:
- Fix two -Wimplicit-function-declaration warnings on Linux by
  including sys/sysmacros.h in fmtdev().
This commit is contained in:
Johnothan King 2021-04-08 11:58:07 -07:00 committed by GitHub
parent ecf260c282
commit a065558291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 299 additions and 282 deletions

View file

@ -357,7 +357,7 @@ const char sh_optalias[] =
"to see whether it is an alias.]"
"[+?If no \aname\as are specified then the names and values of all "
"aliases are written to standard output. Otherwise, for "
"each \aname\a that is specified, and \b=\b\avalue\a is not "
"each \aname\a that is specified, and \b=\b\avalue\a is not "
"specified, the current value of the alias corresponding to "
"\aname\a is written to standard output. If \b=\b\avalue\a is "
"specified, the alias \aname\a will be created or redefined.]"
@ -876,7 +876,7 @@ _JOB_
"\n[job ...]\n"
"\n"
"[+EXIT STATUS?If \bfg\b brings one or more jobs into the foreground, "
"the exit status of \bfg\b will be that of the last \ajob\a. "
"the exit status of \bfg\b will be that of the last \ajob\a. "
"If one or more jobs does not exist or has completed, \bfg\b will "
"return a non-zero exit status.]"
"}"
@ -1374,7 +1374,7 @@ const char sh_optpwd[] =
"[+DESCRIPTION?\bpwd\b writes an absolute pathname of the current working "
"directory to standard output. An absolute pathname is a "
"pathname that begins with \b/\b that does not contains any "
"\b.\b or \b..\b components.]"
"\b.\b or \b..\b components.]"
"[+?If both \b-L\b and \b-P\b are specified, the last one specified will "
"be used. If neither \b-P\b or \b-L\b is specified then the "
"behavior will be determined by the \bgetconf\b parameter "
@ -1777,7 +1777,7 @@ const char sh_opttypeset[] =
"assigned before the attributes are set.]"
"[+?When \btypeset\b is called inside a function defined with the "
"\bfunction\b reserved word, and \aname\a does not contain a "
"\b.\b, then a local variable statically scoped to that function "
"\b.\b, then a local variable statically scoped to that function "
"will be created.]"
"[+?Not all option combinations are possible. For example, the numeric "
"options \b-i\b, \b-E\b, and \b-F\b cannot be specified with "
@ -1844,7 +1844,7 @@ const char sh_opttypeset[] =
"value will be displayed as an unsigned integer.]"
"[x?Puts each \aname\a on the export list. See \bexport\b(1). \aname\a "
"cannot contain a \b.\b.]"
"[A?Associative array. Each \aname\a will converted to an associative "
"[A?Associative array. Each \aname\a is converted to an associative "
"array. If a variable already exists, the current value will "
"become index \b0\b.]"
"[C?Compound variable. Each \aname\a will be a compound variable. If "
@ -1976,7 +1976,7 @@ const char sh_optunset[] =
"[-1c?\n@(#)$Id: unset (AT&T Research) 1999-07-07 $\n]"
"[--catalog?" SH_DICT "]"
"[+NAME?unset - unset values and attributes of variables and functions]"
"[+DESCRIPTION?For each \aname\a specified, \bunset\b unsets the variable, "
"[+DESCRIPTION?For each \aname\a specified, \bunset\b unsets the variable, "
"or function if \b-f\b is specified, from the current shell "
"execution environment. Readonly variables cannot be unset.]"
"[n?If \aname\a refers to variable that is a reference, the variable \aname\a "
@ -2037,7 +2037,7 @@ _JOB_
"\n"
"[+EXIT STATUS?If \await\a is invoked with one or more \ajob\as, and all of "
"them have terminated or were not known by the invoking shell, "
"the exit status of \bwait\b will be that of the last \ajob\a. "
"the exit status of \bwait\b will be that of the last \ajob\a. "
"Otherwise, it will be one of the following:]{"
"[+0?\bwait\b utility was invoked with no operands and all "
"processes known by the invoking process have terminated.]"

View file

@ -411,7 +411,7 @@ const char e_lexlabunknown[] = "line %d: %s unknown label";
const char e_lexobsolete1[] = "line %d: `...` obsolete, use $(...)";
const char e_lexobsolete2[] = "line %d: -a obsolete, use -e";
const char e_lexobsolete3[] = "line %d: '=' obsolete, use '=='";
const char e_lexobsolete4[] = "line %d: %s within [[...]] obsolete, use ((...))";
const char e_lexobsolete4[] = "line %d: %s within [[ ... ]] obsolete, use ((...))";
const char e_lexobsolete5[] = "line %d: set %s obsolete";
const char e_lexobsolete6[] = "line %d: `{' instead of `in' is obsolete";
const char e_lexusebrace[] = "line %d: use braces to avoid ambiguities with $id[...]";

View file

@ -27,7 +27,7 @@
#include "streval.h"
const unsigned char strval_precedence[35] =
/* opcode precedence,assignment */
/* opcode precedence,assignment */
{
/* DEFAULT */ MAXPREC|NOASSIGN,
/* DONE */ 0|NOASSIGN|RASSOC,