Skip to content

Commit

Permalink
try silencing some codeql warnings
Browse files Browse the repository at this point in the history
Change-Id: Iebdcfe4788ad709132595f5be5c95ac0ceb7ace7
  • Loading branch information
cooljeanius committed Dec 10, 2023
1 parent af07e4a commit aecf975
Show file tree
Hide file tree
Showing 32 changed files with 13,476 additions and 7,560 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Dependencies
if: matrix.language == 'c-cpp'
run: sudo apt-get -y install autopoint gobjc clang autogen
run: sudo apt-get -y install autopoint gobjc clang autogen guile-2.2 guile-2.2-dev guile-2.2-libs

- name: Syntax check (and similar stuff)
if: matrix.language == 'ruby' || matrix.language == 'javascript-typescript'
Expand Down
7 changes: 5 additions & 2 deletions macsbug/MacsBug_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,8 +2174,11 @@ void update_macsbug_prompt(void)
char *p, set_prompt_cmd[1024], prompt[1024];

if (!doing_set_prompt && macsbug_screen) {
//prompt_start = sprintf(prompt, GOTO CLEAR_LINE, cmd_top, cmd_left);
prompt_start = sprintf(prompt, GOTO, cmd_top, cmd_left);
#if 0
prompt_start = sprintf(prompt, GOTO CLEAR_LINE, cmd_top, cmd_left);
#endif /* 0 */
prompt_start = snprintf(prompt, sizeof(set_prompt_cmd), GOTO, cmd_top,
cmd_left);
gdb_get_prompt(prompt + prompt_start);
sprintf(set_prompt_cmd, "set prompt %s", prompt);
doing_set_prompt = 1;
Expand Down
4 changes: 2 additions & 2 deletions macsbug/MacsBug_plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ static void tf(char *arg, int from_tty)
gdb_printf("%d%d\n\n", (fpscr.fpscr >> 1) & 1, fpscr.fpscr & 1);

for (i = 0; i < 32; ++i) {
sprintf(f, "$f%d", i);
snprintf(f, sizeof(f), "$f%d", i);
gdb_printf(" FPR%-2d = ", i);

v = gdb_get_register(f, &value);
Expand Down Expand Up @@ -2138,7 +2138,7 @@ static void tv(char *arg, int from_tty)
gdb_printf("\n\n");

for (i = 0; i < 32; ++i) {
sprintf(vn, "$v%d", i);
snprintf(vn, sizeof(vn), "$v%d", i);
gdb_printf(" V%-2d = ", i);

v = gdb_get_register(vn, &value);
Expand Down
2 changes: 1 addition & 1 deletion macsbug/MacsBug_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static FILE *screen_stdout = NULL; /* private stdout with a large buffer */
xterm control sequences thrown at it.
*/

static void write_char(c)
static void write_char(int c)
{
if (cursor_x > row_len[cursor_y-1])
row_len[cursor_y-1] = cursor_x;
Expand Down
2 changes: 1 addition & 1 deletion src/bfd/po/bfd.pot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cgen/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stamp-cgen: $(CGENFILES)
echo "timestamp" > stamp-cgen

all: @MAINT@ all-local
ls
(pwd && ls)

# Phony targets to run each of the applications,
# though most of these are for development purposes only.
Expand Down
2 changes: 1 addition & 1 deletion src/cgen/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ stamp-cgen: $(CGENFILES)
echo "timestamp" > stamp-cgen

all: @MAINT@ all-local
ls
(pwd && ls)

# Phony targets to run each of the applications,
# though most of these are for development purposes only.
Expand Down
4 changes: 2 additions & 2 deletions src/cgen/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.70],,
[m4_warning([this file was generated for autoconf 2.70.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
Expand Down
17 changes: 9 additions & 8 deletions src/cgen/configure
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.70 for cgen 1.1.
# Generated by GNU Autoconf 2.71 for cgen 1.1.
#
# Report bugs to <[email protected]>.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020 Free Software Foundation, Inc.
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
# Inc.
#
#
# This configure script is free software; the Free Software Foundation
Expand Down Expand Up @@ -1414,9 +1415,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cgen configure 1.1
generated by GNU Autoconf 2.70
generated by GNU Autoconf 2.71
Copyright (C) 2020 Free Software Foundation, Inc.
Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
Expand Down Expand Up @@ -1451,7 +1452,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cgen $as_me 1.1, which was
generated by GNU Autoconf 2.70. Invocation command line was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3319,7 +3320,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by cgen $as_me 1.1, which was
generated by GNU Autoconf 2.70. Invocation command line was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
Expand Down Expand Up @@ -3378,10 +3379,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
cgen config.status 1.1
configured by $0, generated by GNU Autoconf 2.70,
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2020 Free Software Foundation, Inc.
Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
Expand Down
7 changes: 7 additions & 0 deletions src/expect/configure
Original file line number Diff line number Diff line change
Expand Up @@ -10004,6 +10004,9 @@ fi
#
# Look for functions that may be missing
#
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
printf %s "checking for uid_t in sys/types.h... " >&6; }
if test ${ac_cv_type_uid_t+y}
Expand Down Expand Up @@ -10097,6 +10100,10 @@ printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi

ac_func=
for ac_item in $ac_func_c_list
Expand Down
7 changes: 7 additions & 0 deletions src/expect/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,14 @@ AC_CHECK_MEMBERS([struct stat.st_rdev])dnl
#
# Look for functions that may be missing
#
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
AC_FUNC_CHOWN
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi
AC_FUNC_FORK
AC_FUNC_GETPGRP
AC_FUNC_MALLOC
Expand Down
2 changes: 2 additions & 0 deletions src/gdb/cli/cli-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,8 @@ lookup_cmd_composition(const char *text, struct cmd_list_element **alias,
return 0;

len = (p - text);
if (len < 0)
len = labs(len);

/* text and p now bracket the first command word to lookup (and its
* length is len). We copy this into a local temporary */
Expand Down
10 changes: 10 additions & 0 deletions src/gdb/inferior.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ int ptrace_wait(ptid_t, int *);

extern void child_resume(ptid_t, int, enum target_signal);

#ifndef PTRACE_TYPE_ARG3
# if defined(PTRACE_ARG3_IS_CADDR_T) && (defined(HAVE_CADDR_T) || defined(caddr_t))
# define PTRACE_TYPE_ARG3 caddr_t
# else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "unsure what to define PTRACE_TYPE_ARG3 to"
# endif /* __GNUC__ && !__STRICT_ANSI__ */
# endif /* PTRACE_ARG3_IS_CADDR_T && (HAVE_CADDR_T || caddr_t) */
#endif /* !PTRACE_TYPE_ARG3 */

#ifndef PTRACE_ARG3_TYPE
# define PTRACE_ARG3_TYPE PTRACE_TYPE_ARG3
#endif /* !PTRACE_ARG3_TYPE */
Expand Down
2 changes: 1 addition & 1 deletion src/gdb/macosx/macosx-nat-mutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ gc_print_references(volatile CORE_ADDR list_addr, int wordsize)

for (ref_index = 0; ref_index < num_refs; ref_index++)
{
struct cleanup *ref_cleanup;
struct cleanup *volatile ref_cleanup;
LONGEST offset;
ULONGEST address;
ULONGEST kind;
Expand Down
2 changes: 1 addition & 1 deletion src/gdb/mi/mi-cmd-var.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ mi_cmd_var_create(char *command, char **argv, int argc)

if (colon)
{
struct symtabs_and_lines sals = { NULL, 0, 0 };
volatile struct symtabs_and_lines sals = { NULL, 0, 0 };
struct cleanup *old_chain = NULL;

TRY_CATCH(except, RETURN_MASK_ALL)
Expand Down
7 changes: 7 additions & 0 deletions src/readline/configure
Original file line number Diff line number Diff line change
Expand Up @@ -8093,6 +8093,9 @@ printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5
printf %s "checking for working chown... " >&6; }
if test ${ac_cv_func_chown_works+y}
Expand Down Expand Up @@ -8191,6 +8194,10 @@ esac

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi

ac_func=
for ac_item in $ac_func_c_list
Expand Down
7 changes: 7 additions & 0 deletions src/readline/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,15 @@ AC_MSG_CHECKING([functions])
AC_MSG_RESULT([ ])
AM_WITH_DMALLOC
AC_FUNC_ALLOCA
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
AC_FUNC_CHOWN
AC_FUNC_ERROR_AT_LINE
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi
AC_FUNC_FORK
AC_FUNC_LSTAT dnl# also checks whether it "_FOLLOWS_SLASHED_SYMLINK"
AC_FUNC_MALLOC
Expand Down
7 changes: 7 additions & 0 deletions src/readline/examples/rlfe.dir/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5259,6 +5259,9 @@ printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h
fi

# Checks for library functions.
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5
printf %s "checking for working chown... " >&6; }
if test ${ac_cv_func_chown_works+y}
Expand Down Expand Up @@ -5320,6 +5323,10 @@ printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi

ac_func=
for ac_item in $ac_func_c_list
Expand Down
7 changes: 7 additions & 0 deletions src/readline/examples/rlfe.dir/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,14 @@ AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])dnl

# Checks for library functions.
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
AC_FUNC_CHOWN
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_STAT
Expand Down
7 changes: 7 additions & 0 deletions src/tcl/configure
Original file line number Diff line number Diff line change
Expand Up @@ -6820,6 +6820,9 @@ printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5
printf %s "checking for working chown... " >&6; }
if test ${ac_cv_func_chown_works+y}
Expand Down Expand Up @@ -6881,6 +6884,10 @@ printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h

fi

if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi

ac_func=
for ac_item in $ac_func_c_list
Expand Down
7 changes: 7 additions & 0 deletions src/tcl/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ AC_CHECK_MEMBERS([struct stat.st_rdev])dnl

# Checks for library functions.
AC_FUNC_ALLOCA
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_chown_works=yes
fi
AC_FUNC_CHOWN
if test "x${GITHUB_ACTIONS}" = "xtrue" && test "x${CODEQL_ACTION_FEATURE_WILL_UPLOAD}" = "xtrue"; then
export ac_cv_func_fork_works=yes
export ac_cv_func_vfork_works=yes
fi
AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_MALLOC
Expand Down
10 changes: 5 additions & 5 deletions src/tk/aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-

# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -14,7 +14,7 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# AM_CONDITIONAL -*- Autoconf -*-

# Copyright (C) 1997-2018 Free Software Foundation, Inc.
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -48,7 +48,7 @@ fi])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering

# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -81,7 +81,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
]
)

# Copyright (C) 2006-2018 Free Software Foundation, Inc.
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down
Loading

0 comments on commit aecf975

Please sign in to comment.