Commit 853e2d99 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Add a new warning to our "warn a lot" list: unused parameters. This means we...

Add a new warning to our "warn a lot" list: unused parameters.  This means we have to explicitly "use" unuseds, but it can catch bugs.  (It caught two coding mistakes so far.)


svn:r6532
parent c4647545
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ else
fi
# Add some more warnings which we use in the cvs version but not in the
# released versions.  (Some relevant gcc versions can't handle these.)
#CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline"
#CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline"
# Add these in when you feel like fun.
#CFLAGS="$CFLAGS -Wbad-function-cast -Werror -Wdeclaration-after-statement -Wold-style-definition"

+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ void
tor_munmap_file(const char *memory, size_t size)
{
  char *mem = (char*) memory;
  (void)size;
  tor_free(mem);
}
#endif
+2 −0
Original line number Diff line number Diff line
@@ -1802,6 +1802,8 @@ secret_to_key(char *key_out, size_t key_out_len, const char *secret,
static void
_openssl_locking_cb(int mode, int n, const char *file, int line)
{
  (void)file;
  (void)line;
  if (!_openssl_mutexes)
    /* This is not a really good  fix for the
     * "release-freed-lock-from-separate-thread-on-shutdown" problem, but
+2 −0
Original line number Diff line number Diff line
@@ -950,6 +950,8 @@ clean_name_for_stat(char *name)
      return;
    name[len-1]='\0';
  }
#else
  (void)name;
#endif
}

+1 −0
Original line number Diff line number Diff line
@@ -1508,6 +1508,7 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
  routerinfo_t *r, *choice;
  smartlist_t *excluded;
  or_options_t *options = get_options();
  (void)purpose; /* not used yet. */

  if (state && options->UseEntryGuards) {
    return choose_random_entry(state);
Loading