Skip to content

-Werror=... #1220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft

Conversation

alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Feb 19, 2025

Closes: #1218
Reported-by: @zeha


Revisions:

v2
  • Promote this diagnostic to an error.
$ git range-diff master gh/c c
1:  5ba2ba92 = 1:  5ba2ba92 lib/string/strspn/: Add missing const
-:  -------- > 2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
v3
  • Turn on -Werror=all.
  • Remove unnecessary uses of [[gnu::unused]]. In some cases, we can remove the parameter. In others, we can't but we can unname it. That attribute should only be used when the use of a variable is conditionally compiled.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 -:  -------- >  3:  5de673ed lib/, src/: Remove unused variables
 -:  -------- >  4:  f0dfbb85 src/: Unname unused parameter of main()
 -:  -------- >  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 -:  -------- >  6:  1df3863f autogen.sh: CFLAGS: Promote -Wall to errors
 -:  -------- >  7:  f5624170 lib/, src/: Unname unused parameters in callbacks
 -:  -------- >  8:  56db38b0 lib/, src/: Remove unused parameter $2 of audit_logger()
 -:  -------- >  9:  c7a7513f lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 -:  -------- > 10:  7c0ce754 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 -:  -------- > 11:  14ebca70 lib/logind.c: Unname unused function parameter
 -:  -------- > 12:  f93d7e81 lib/: Remove unused parameter $3 of password_check() and propagate
 -:  -------- > 13:  421654e1 lib/obscure.c: Remove unused parameter $1 of palindrome()
 -:  -------- > 14:  503682c1 lib/, src/: Remove unused parameter $3 of passwd_check()
v4
  • Use [[gnu::unused]] in parameters used in conditionally-compiled code.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 7:  f5624170 =  6:  f2f13d07 lib/, src/: Unname unused parameters in callbacks
 8:  56db38b0 =  7:  67a658cf lib/, src/: Remove unused parameter $2 of audit_logger()
 9:  c7a7513f =  8:  18f1f3cc lib/copydir.c: Remove unused parameter $3 of copy_symlink()
10:  7c0ce754 =  9:  095b7651 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
11:  14ebca70 = 10:  3f9fc084 lib/logind.c: Unname unused function parameter
12:  f93d7e81 = 11:  ac00a045 lib/: Remove unused parameter $3 of password_check() and propagate
13:  421654e1 = 12:  579d5cdc lib/obscure.c: Remove unused parameter $1 of palindrome()
14:  503682c1 = 13:  c3c3b0c3 lib/, src/: Remove unused parameter $3 of passwd_check()
 -:  -------- > 14:  9be92409 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
 6:  1df3863f = 15:  fc85fca7 autogen.sh: CFLAGS: Promote -Wall to errors
v4b
  • Add MAYBE_UNUSED to more parameters.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  f2f13d07 =  6:  f2f13d07 lib/, src/: Unname unused parameters in callbacks
 7:  67a658cf =  7:  67a658cf lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  18f1f3cc =  8:  18f1f3cc lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  095b7651 =  9:  095b7651 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3f9fc084 = 10:  3f9fc084 lib/logind.c: Unname unused function parameter
11:  ac00a045 = 11:  ac00a045 lib/: Remove unused parameter $3 of password_check() and propagate
12:  579d5cdc = 12:  579d5cdc lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c3c3b0c3 = 13:  c3c3b0c3 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  9be92409 ! 14:  94d17777 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
    @@ Commit message
     
         Signed-off-by: Alejandro Colomar <[email protected]>
     
    + ## lib/copydir.c ##
    +@@ lib/copydir.c: static int copy_hardlink (const struct path_info *dst,
    +  *        Return 0 on success, -1 on error.
    +  */
    + static int
    +-copy_special(const struct path_info *src, const struct path_info *dst,
    +-             bool reset_selinux,
    ++copy_special(MAYBE_UNUSED const struct path_info *src, const struct path_info *dst,
    ++             MAYBE_UNUSED bool reset_selinux,
    +              const struct stat *statp, const struct timespec mt[],
    +              uid_t old_uid, uid_t new_uid,
    +              gid_t old_gid, gid_t new_gid)
    +@@ lib/copydir.c: copy_special(const struct path_info *src, const struct path_info *dst,
    +  *        Return 0 on success, -1 on error.
    +  */
    + static int copy_file (const struct path_info *src, const struct path_info *dst,
    +-                      bool reset_selinux,
    ++                      MAYBE_UNUSED bool reset_selinux,
    +                       const struct stat *statp, const struct timespec mt[],
    +                       uid_t old_uid, uid_t new_uid,
    +                       gid_t old_gid, gid_t new_gid)
    +
      ## lib/idmapping.c ##
     @@
      #include "alloc/calloc.h"
15:  fc85fca7 = 15:  4cf42b03 autogen.sh: CFLAGS: Promote -Wall to errors
v5
  • Attempt to calm down the compiler on a function-like macro whose return value is unused.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  f2f13d07 =  6:  f2f13d07 lib/, src/: Unname unused parameters in callbacks
 7:  67a658cf =  7:  67a658cf lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  18f1f3cc =  8:  18f1f3cc lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  095b7651 =  9:  095b7651 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3f9fc084 = 10:  3f9fc084 lib/logind.c: Unname unused function parameter
11:  ac00a045 = 11:  ac00a045 lib/: Remove unused parameter $3 of password_check() and propagate
12:  579d5cdc = 12:  579d5cdc lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c3c3b0c3 = 13:  c3c3b0c3 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  94d17777 = 14:  94d17777 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  4cf42b03 = 15:  4cf42b03 autogen.sh: CFLAGS: Promote -Wall to errors
 -:  -------- > 16:  4a06a625 lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
v5b
  • Add [[gnu::unused]] to variables used in conditionally-compiled code.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  f2f13d07 =  6:  f2f13d07 lib/, src/: Unname unused parameters in callbacks
 7:  67a658cf =  7:  67a658cf lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  18f1f3cc =  8:  18f1f3cc lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  095b7651 =  9:  095b7651 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3f9fc084 = 10:  3f9fc084 lib/logind.c: Unname unused function parameter
11:  ac00a045 = 11:  ac00a045 lib/: Remove unused parameter $3 of password_check() and propagate
12:  579d5cdc = 12:  579d5cdc lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c3c3b0c3 = 13:  c3c3b0c3 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  94d17777 = 14:  94d17777 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  4cf42b03 = 15:  4cf42b03 autogen.sh: CFLAGS: Promote -Wall to errors
16:  4a06a625 = 16:  4a06a625 lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
 -:  -------- > 17:  0cb31022 lib/: Add [[gnu::unused]] to unused variables
v6
  • Unname unused parameters in tests/.
  • Fix commit message
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  f2f13d07 !  6:  d2590bd7 lib/, src/: Unname unused parameters in callbacks
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/, src/: Unname unused parameters in callbacks
    +    lib/, src/ tests/: Unname unused parameters in callbacks
     
         Signed-off-by: Alejandro Colomar <[email protected]>
     
    @@ src/sulogin.c: static void catch_signals (int);
      {
        _exit (1);
      }
    +
    + ## tests/unit/test_adds.c ##
    +@@
    + #include "adds.h"
    + 
    + 
    +-static void test_addsl_2_ok(void **state);
    +-static void test_addsl_2_underflow(void **state);
    +-static void test_addsl_2_overflow(void **state);
    +-static void test_addsl_3_ok(void **state);
    +-static void test_addsl_3_underflow(void **state);
    +-static void test_addsl_3_overflow(void **state);
    +-static void test_addsl_5_ok(void **state);
    ++static void test_addsl_2_ok(void **);
    ++static void test_addsl_2_underflow(void **);
    ++static void test_addsl_2_overflow(void **);
    ++static void test_addsl_3_ok(void **);
    ++static void test_addsl_3_underflow(void **);
    ++static void test_addsl_3_overflow(void **);
    ++static void test_addsl_5_ok(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_adds.c: main(void)
    + 
    + 
    + static void
    +-test_addsl_2_ok(void **state)
    ++test_addsl_2_ok(void **)
    + {
    +   assert_true(addsl(1, 3)                 == 1 + 3);
    +   assert_true(addsl(-4321, 7)             == -4321 + 7);
    +@@ tests/unit/test_adds.c: test_addsl_2_ok(void **state)
    + 
    + 
    + static void
    +-test_addsl_2_underflow(void **state)
    ++test_addsl_2_underflow(void **)
    + {
    +   assert_true(addsl(LONG_MIN, -1)         == LONG_MIN);
    +   assert_true(addsl(LONG_MIN + 3, -7)     == LONG_MIN);
    +@@ tests/unit/test_adds.c: test_addsl_2_underflow(void **state)
    + 
    + 
    + static void
    +-test_addsl_2_overflow(void **state)
    ++test_addsl_2_overflow(void **)
    + {
    +   assert_true(addsl(LONG_MAX, 1)          == LONG_MAX);
    +   assert_true(addsl(LONG_MAX - 3, 7)      == LONG_MAX);
    +@@ tests/unit/test_adds.c: test_addsl_2_overflow(void **state)
    + 
    + 
    + static void
    +-test_addsl_3_ok(void **state)
    ++test_addsl_3_ok(void **)
    + {
    +   assert_true(addsl(1, 2, 3)              == 1 + 2 + 3);
    +   assert_true(addsl(LONG_MIN, -3, 4)      == LONG_MIN + 4 - 3);
    +@@ tests/unit/test_adds.c: test_addsl_3_ok(void **state)
    + 
    + 
    + static void
    +-test_addsl_3_underflow(void **state)
    ++test_addsl_3_underflow(void **)
    + {
    +   assert_true(addsl(LONG_MIN, 2, -3)      == LONG_MIN);
    +   assert_true(addsl(LONG_MIN, -1, 0)      == LONG_MIN);
    +@@ tests/unit/test_adds.c: test_addsl_3_underflow(void **state)
    + 
    + 
    + static void
    +-test_addsl_3_overflow(void **state)
    ++test_addsl_3_overflow(void **)
    + {
    +   assert_true(addsl(LONG_MAX, -1, 2)      == LONG_MAX);
    +   assert_true(addsl(LONG_MAX, +1, 0)      == LONG_MAX);
    +@@ tests/unit/test_adds.c: test_addsl_3_overflow(void **state)
    + 
    + 
    + static void
    +-test_addsl_5_ok(void **state)
    ++test_addsl_5_ok(void **)
    + {
    +   assert_true(addsl(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN, 44) == 42);
    + }
    +
    + ## tests/unit/test_atoi_strtoi.c ##
    +@@
    + #include "atoi/strtoi/strtou_noneg.h"
    + 
    + 
    +-static void test_strtoi(void **state);
    +-static void test_strtou(void **state);
    +-static void test_strtou_noneg(void **state);
    ++static void test_strtoi(void **);
    ++static void test_strtou(void **);
    ++static void test_strtou_noneg(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_atoi_strtoi.c: main(void)
    + 
    + 
    + static void
    +-test_strtoi(void **state)
    ++test_strtoi(void **)
    + {
    +   int   status;
    +   char  *end;
    +@@ tests/unit/test_atoi_strtoi.c: test_strtoi(void **state)
    + 
    + 
    + static void
    +-test_strtou(void **state)
    ++test_strtou(void **)
    + {
    +   int   status;
    +   char  *end;
    +@@ tests/unit/test_atoi_strtoi.c: test_strtou(void **state)
    + 
    + 
    + static void
    +-test_strtou_noneg(void **state)
    ++test_strtou_noneg(void **)
    + {
    +   int   status;
    +   char  *end;
    +
    + ## tests/unit/test_chkname.c ##
    +@@
    + #include "chkname.h"
    + 
    + 
    +-static void test_is_valid_user_name_ok(void **state);
    +-static void test_is_valid_user_name_ok_dollar(void **state);
    +-static void test_is_valid_user_name_nok_dash(void **state);
    +-static void test_is_valid_user_name_nok_dir(void **state);
    +-static void test_is_valid_user_name_nok_dollar(void **state);
    +-static void test_is_valid_user_name_nok_empty(void **state);
    +-static void test_is_valid_user_name_nok_numeric(void **state);
    +-static void test_is_valid_user_name_nok_otherchars(void **state);
    +-static void test_is_valid_user_name_long(void **state);
    ++static void test_is_valid_user_name_ok(void **);
    ++static void test_is_valid_user_name_ok_dollar(void **);
    ++static void test_is_valid_user_name_nok_dash(void **);
    ++static void test_is_valid_user_name_nok_dir(void **);
    ++static void test_is_valid_user_name_nok_dollar(void **);
    ++static void test_is_valid_user_name_nok_empty(void **);
    ++static void test_is_valid_user_name_nok_numeric(void **);
    ++static void test_is_valid_user_name_nok_otherchars(void **);
    ++static void test_is_valid_user_name_long(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_chkname.c: main(void)
    + 
    + 
    + static void
    +-test_is_valid_user_name_ok(void **state)
    ++test_is_valid_user_name_ok(void **)
    + {
    +   assert_true(is_valid_user_name("alx"));
    +   assert_true(is_valid_user_name("u-ser"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_ok(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_ok_dollar(void **state)
    ++test_is_valid_user_name_ok_dollar(void **)
    + {
    +   // Non-POSIX extension for Samba 3.x "add machine script".
    +   assert_true(is_valid_user_name("dollar$"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_ok_dollar(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_dash(void **state)
    ++test_is_valid_user_name_nok_dash(void **)
    + {
    +   assert_true(false == is_valid_user_name("-"));
    +   assert_true(false == is_valid_user_name("-not-valid"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_dash(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_dir(void **state)
    ++test_is_valid_user_name_nok_dir(void **)
    + {
    +   assert_true(false == is_valid_user_name("."));
    +   assert_true(false == is_valid_user_name(".."));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_dir(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_dollar(void **state)
    ++test_is_valid_user_name_nok_dollar(void **)
    + {
    +   assert_true(false == is_valid_user_name("$"));
    +   assert_true(false == is_valid_user_name("$dollar"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_dollar(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_empty(void **state)
    ++test_is_valid_user_name_nok_empty(void **)
    + {
    +   assert_true(false == is_valid_user_name(""));
    + }
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_numeric(void **state)
    ++test_is_valid_user_name_nok_numeric(void **)
    + {
    +   assert_true(false == is_valid_user_name("6"));
    +   assert_true(false == is_valid_user_name("42"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_numeric(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_nok_otherchars(void **state)
    ++test_is_valid_user_name_nok_otherchars(void **)
    + {
    +   assert_true(false == is_valid_user_name("no spaces"));
    +   assert_true(false == is_valid_user_name("no,"));
    +@@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_otherchars(void **state)
    + 
    + 
    + static void
    +-test_is_valid_user_name_long(void **state)
    ++test_is_valid_user_name_long(void **)
    + {
    +   size_t  max;
    +   char    *name;
    +
    + ## tests/unit/test_logind.c ##
    +@@ tests/unit/test_logind.c: __wrap_sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions)
    + /***********************
    +  * TEST
    +  **********************/
    +-static void test_active_sessions_count_return_ok(void **state)
    ++static void
    ++test_active_sessions_count_return_ok(void **)
    + {
    +     int count;
    +     struct passwd *pw = malloc(sizeof(struct passwd));
    +@@ tests/unit/test_logind.c: static void test_active_sessions_count_return_ok(void **state)
    +     assert_int_equal(count, 1);
    + }
    + 
    +-static void test_active_sessions_count_prefix_getpwnam_failure(void **state)
    ++static void
    ++test_active_sessions_count_prefix_getpwnam_failure(void **)
    + {
    +     int count;
    +     struct passwd *pw = NULL;
    +
    + ## tests/unit/test_snprintf.c ##
    +@@
    + #include "string/sprintf/snprintf.h"
    + 
    + 
    +-static void test_SNPRINTF_trunc(void **state);
    +-static void test_SNPRINTF_ok(void **state);
    ++static void test_SNPRINTF_trunc(void **);
    ++static void test_SNPRINTF_ok(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_snprintf.c: main(void)
    + 
    + 
    + static void
    +-test_SNPRINTF_trunc(void **state)
    ++test_SNPRINTF_trunc(void **)
    + {
    +   char  buf[NITEMS("foo")];
    + 
    +@@ tests/unit/test_snprintf.c: test_SNPRINTF_trunc(void **state)
    + 
    + 
    + static void
    +-test_SNPRINTF_ok(void **state)
    ++test_SNPRINTF_ok(void **)
    + {
    +   char  buf[NITEMS("foo")];
    + 
    +
    + ## tests/unit/test_strncpy.c ##
    +@@
    + #include "string/strcpy/strncpy.h"
    + 
    + 
    +-static void test_STRNCPY_trunc(void **state);
    +-static void test_STRNCPY_fit(void **state);
    +-static void test_STRNCPY_pad(void **state);
    ++static void test_STRNCPY_trunc(void **);
    ++static void test_STRNCPY_fit(void **);
    ++static void test_STRNCPY_pad(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_strncpy.c: main(void)
    + 
    + 
    + static void
    +-test_STRNCPY_trunc(void **state)
    ++test_STRNCPY_trunc(void **)
    + {
    +   char  buf[3];
    + 
    +@@ tests/unit/test_strncpy.c: test_STRNCPY_trunc(void **state)
    + 
    + 
    + static void
    +-test_STRNCPY_fit(void **state)
    ++test_STRNCPY_fit(void **)
    + {
    +   char  buf[3];
    + 
    +@@ tests/unit/test_strncpy.c: test_STRNCPY_fit(void **state)
    + 
    + 
    + static void
    +-test_STRNCPY_pad(void **state)
    ++test_STRNCPY_pad(void **)
    + {
    +   char  buf[3];
    + 
    +
    + ## tests/unit/test_strtcpy.c ##
    +@@
    + #include "string/strcpy/strtcpy.h"
    + 
    + 
    +-static void test_STRTCPY_trunc(void **state);
    +-static void test_STRTCPY_ok(void **state);
    ++static void test_STRTCPY_trunc(void **);
    ++static void test_STRTCPY_ok(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_strtcpy.c: main(void)
    + 
    + 
    + static void
    +-test_STRTCPY_trunc(void **state)
    ++test_STRTCPY_trunc(void **)
    + {
    +   char  buf[NITEMS("foo")];
    + 
    +@@ tests/unit/test_strtcpy.c: test_STRTCPY_trunc(void **state)
    + 
    + 
    + static void
    +-test_STRTCPY_ok(void **state)
    ++test_STRTCPY_ok(void **)
    + {
    +   char  buf[NITEMS("foo")];
    + 
    +
    + ## tests/unit/test_typetraits.c ##
    +@@
    + #include "typetraits.h"
    + 
    + 
    +-static void test_type_max(void **state);
    +-static void test_type_min(void **state);
    ++static void test_type_max(void **);
    ++static void test_type_min(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_typetraits.c: main(void)
    + 
    + 
    + static void
    +-test_type_max(void **state)
    ++test_type_max(void **)
    + {
    +   assert_true(type_max(long) == LONG_MAX);
    +   assert_true(type_max(unsigned long) == ULONG_MAX);
    +@@ tests/unit/test_typetraits.c: test_type_max(void **state)
    + 
    + 
    + static void
    +-test_type_min(void **state)
    ++test_type_min(void **)
    + {
    +   assert_true(type_min(long) == LONG_MIN);
    +   assert_true(type_min(unsigned long) == 0);
    +
    + ## tests/unit/test_xasprintf.c ##
    +@@ tests/unit/test_xasprintf.c: void __wrap_exit(int status);
    + static int xasprintf_volatile(char *volatile *restrict s,
    +     const char *restrict fmt, ...);
    + 
    +-static void test_xasprintf_exit(void **state);
    +-static void test_xasprintf_ok(void **state);
    ++static void test_xasprintf_exit(void **);
    ++static void test_xasprintf_ok(void **);
    + 
    + 
    + int
    +@@ tests/unit/test_xasprintf.c: xasprintf_volatile(char *volatile *restrict s, const char *restrict fmt, ...)
    + 
    + 
    + static void
    +-test_xasprintf_exit(void **state)
    ++test_xasprintf_exit(void **)
    + {
    +   volatile int    len;
    +   char *volatile  p;
    +@@ tests/unit/test_xasprintf.c: test_xasprintf_exit(void **state)
    + 
    + 
    + static void
    +-test_xasprintf_ok(void **state)
    ++test_xasprintf_ok(void **)
    + {
    +   int   len;
    +   char  *p;
 7:  67a658cf =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  18f1f3cc =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  095b7651 =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3f9fc084 = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  ac00a045 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  579d5cdc = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c3c3b0c3 = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  94d17777 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  4cf42b03 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  4a06a625 = 16:  092f4c2a lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
17:  0cb31022 ! 17:  0fcaa13c lib/: Add [[gnu::unused]] to unused variables
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/: Add [[gnu::unused]] to unused variables
    +    lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
     
         Signed-off-by: Alejandro Colomar <[email protected]>
     
alx@debian:/srv/alx/src/shadow/shadow/master/tests/unit$ 
v6b
  • tfix
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  092f4c2a ! 16:  583d31e6 lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
    @@ lib/sssd.h
      extern int sssd_flush_cache (int dbflags);
      #else
     -#define sssd_flush_cache(service) (0)
    -+#define sssd_flush_cache(service) (MAYBE UNUSED 0)
    ++#define sssd_flush_cache(service) (MAYBE_UNUSED 0)
      #endif
      
      #endif
17:  0fcaa13c = 17:  49759c9b lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
v6c
  • Using [[gnu::unused]] with a literal doesn't seem to be valid (see v5). Use a static inline function instead.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  583d31e6 ! 16:  9d0c6094 lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/sssd.h: Add [[gnu::unused]] to function-like macro return value
    +    lib/sssd.h: sssd_flush_cache(): Define as static inline function
     
    -    All callers ignore it.
    +    Being a macro, the unused return value triggers a diagnostic.
    +    This probably needs further investigation, but we have the issue linked
    +    below for that.
     
         Link: <https://github.com/shadow-maint/shadow/issues/1221>
         Signed-off-by: Alejandro Colomar <[email protected]>
    @@ lib/sssd.h
      extern int sssd_flush_cache (int dbflags);
      #else
     -#define sssd_flush_cache(service) (0)
    -+#define sssd_flush_cache(service) (MAYBE_UNUSED 0)
    ++static inline int
    ++sssd_flush_cache(int)
    ++{
    ++  return 0;
    ++}
      #endif
      
      #endif
17:  49759c9b = 17:  40fde621 lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
v7
  • Ignore diagnostic with a pragma in tests/.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  9d0c6094 = 16:  9d0c6094 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  40fde621 = 17:  40fde621 lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
 -:  -------- > 18:  23dbdd27 tests/unit/test_snprintf.c: Ignore diagnostic in test
v7b
  • tfix
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  9d0c6094 = 16:  9d0c6094 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  40fde621 = 17:  40fde621 lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  23dbdd27 ! 18:  56973ecd tests/unit/test_snprintf.c: Ignore diagnostic in test
    @@ tests/unit/test_snprintf.c: test_SNPRINTF_ok(void **)
        assert_true(strcmp(buf, "f") == 0);
      
     +#pragma GCC diagnostic push
    -+#pragma GCC diagnostic ignored -Wformat-zero-length
    ++#pragma GCC diagnostic ignored "-Wformat-zero-length"
        assert_true(SNPRINTF(buf, "") == strlen(""));
     +#pragma GCC diagnostic pop
        assert_true(strcmp(buf, "") == 0);
v8
  • Delete tests for STRNCPY(). They hit a GCC bug (see commit message of commit 19; at least I consider it to be a bug). Cc: @msebor, @pinskia
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  9d0c6094 = 16:  9d0c6094 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  40fde621 = 17:  40fde621 lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  56973ecd = 18:  56973ecd tests/unit/test_snprintf.c: Ignore diagnostic in test
 -:  -------- > 19:  a1a6c816 tests/unit/test_strncpy.c: Remove STRNCPY() tests
v9
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 =  6:  d2590bd7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  a07cd075 =  7:  a07cd075 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  476ded42 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  1d767cab lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  3eb96c1e lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  82f3f224 lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  26ac3124 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  3373d4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  cc6f0fc4 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  333447e8 autogen.sh: CFLAGS: Promote -Wall to errors
16:  9d0c6094 = 16:  9d0c6094 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  40fde621 = 17:  40fde621 lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  56973ecd = 18:  56973ecd tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  a1a6c816 = 19:  a1a6c816 tests/unit/test_strncpy.c: Remove STRNCPY() tests
 -:  -------- > 20:  06d90b3b lib/sizeof.h: ssizeof(): Add signed variant of sizeof
 -:  -------- > 21:  73c99d4d src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
 -:  -------- > 22:  5bdc1b55 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
v10
  • Fix more stuff uncovered by -Werror=all. We really needed this thing!!
$ git range-diff master 5bdc1b5 c 
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2590bd7 !  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
    @@ tests/unit/test_typetraits.c: test_type_max(void **state)
        assert_true(type_min(unsigned long) == 0);
     
      ## tests/unit/test_xasprintf.c ##
    -@@ tests/unit/test_xasprintf.c: void __wrap_exit(int status);
    +@@ tests/unit/test_xasprintf.c: static jmp_buf  jmpb;
    + 
    + int __real_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
    + int __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
    +-void __wrap_exit(int status);
    ++void __wrap_exit(int);
    + 
    + [[gnu::noipa]]
      static int xasprintf_volatile(char *volatile *restrict s,
          const char *restrict fmt, ...);
      
    @@ tests/unit/test_xasprintf.c: void __wrap_exit(int status);
      
      
      int
    +@@ tests/unit/test_xasprintf.c: __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap)
    + 
    + 
    + void
    +-__wrap_exit(int status)
    ++__wrap_exit(int)
    + {
    +   longjmp(jmpb, EXIT_CALLED);
    + }
     @@ tests/unit/test_xasprintf.c: xasprintf_volatile(char *volatile *restrict s, const char *restrict fmt, ...)
      
      
 7:  a07cd075 =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  476ded42 =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1d767cab =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  3eb96c1e = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  82f3f224 = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  26ac3124 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  3373d4cb = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cc6f0fc4 = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  333447e8 = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  9d0c6094 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  40fde621 = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  56973ecd = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  a1a6c816 = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  06d90b3b = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  73c99d4d = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  5bdc1b55 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
 -:  -------- > 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
v11
  • -Wno-error=yacc for now. We have a PR for removing that code, anyway.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  98bc5f3d = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  db8adb40 = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
 -:  -------- > 24:  9d10a987 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
v11b
  • -Wno-error=yacc was problematic. Let's try -Wno-yacc.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  98bc5f3d = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  db8adb40 = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
24:  9d10a987 ! 24:  c30e9971 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
      
      CFLAGS="-O2"
      CFLAGS="$CFLAGS -Werror=all"
    -+CFLAGS="$CFLAGS -Wno-error=yacc"
    ++CFLAGS="$CFLAGS -Wno-yacc"
      CFLAGS="$CFLAGS -Wextra"
      CFLAGS="$CFLAGS -Werror=discarded-qualifiers"
      CFLAGS="$CFLAGS -Werror=incompatible-pointer-types"
v12
  • Address more issues found by CI on Fedora.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  98bc5f3d = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  db8adb40 = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
24:  c30e9971 = 24:  c30e9971 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
 -:  -------- > 25:  b0e48712 src/login.c: Wrap in ifdefs variables used in conditionally-compiled code
v12b
  • Revert changes from v12. They seem to be wrong.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  98bc5f3d = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  db8adb40 = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
24:  c30e9971 = 24:  c30e9971 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
25:  b0e48712 <  -:  -------- src/login.c: Wrap in ifdefs variables used in conditionally-compiled code
v12c
  • It seems I was missing another place to wrap in ifndef in v12. Reintroduce that change, but this time correctly.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e = 14:  edf5ec1e lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  98bc5f3d = 15:  98bc5f3d autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  d6b6c572 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af = 17:  101451af lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
18:  db8adb40 = 18:  db8adb40 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  7f48d8af tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  1dd68dc0 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  943d19e7 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  059df465 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  ada5d80c tests/unit/test_xasprintf.c: Actually return
24:  c30e9971 = 24:  c30e9971 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
 -:  -------- > 25:  040c8c2f src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
v12d
  • Fix more issues uncovered by CI (fedora).
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 =  6:  ffa93c84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  2c35ecdd =  7:  2c35ecdd lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  7f14a1ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  78e718c6 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  d7eec57a lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  7676348e lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  f4410b88 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  b90c5379 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  edf5ec1e ! 14:  13a59bd3 lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
    +    lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
     
         Signed-off-by: Alejandro Colomar <[email protected]>
     
    @@ lib/log.c: void dolastlog (
      {
        int fd;
        off_t offset;
    +
    + ## src/newusers.c ##
    +@@
    + #include "alloc/reallocf.h"
    + #include "atoi/getnum.h"
    + #include "atoi/str2i/str2s.h"
    ++#include "attr.h"
    + #ifdef ACCT_TOOLS_SETUID
    + #ifdef USE_PAM
    + #include "pam_defs.h"
    +@@ src/newusers.c: static int update_passwd (struct passwd *pwd, const char *password)
    + /*
    +  * add_passwd - add or update the encrypted password
    +  */
    +-static int add_passwd (struct passwd *pwd, const char *password)
    ++static int
    ++add_passwd(struct passwd *pwd, MAYBE_UNUSED const char *password)
    + {
    +   const struct spwd *sp;
    +   struct spwd spent;
15:  98bc5f3d = 15:  c61824f0 autogen.sh: CFLAGS: Promote -Wall to errors
16:  d6b6c572 = 16:  9c6e635f lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  101451af ! 17:  28306b3b lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/prefix_flag.c: Add [[gnu::unused]] to unused variable
    +    lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
     
         Signed-off-by: Alejandro Colomar <[email protected]>
     
18:  db8adb40 = 18:  5250b7fe tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7f48d8af = 19:  0f83b7ef tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1dd68dc0 = 20:  41740663 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  943d19e7 = 21:  c9f69631 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  059df465 = 22:  75c89847 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  ada5d80c = 23:  4549f7fe tests/unit/test_xasprintf.c: Actually return
24:  c30e9971 = 24:  cc7683b8 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
25:  040c8c2f = 25:  1cd434f0 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
v12e
  • And finally, this should cleanly pass CI.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ffa93c84 !  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
    @@ tests/unit/test_chkname.c: test_is_valid_user_name_nok_otherchars(void **state)
        char    *name;
     
      ## tests/unit/test_logind.c ##
    +@@
    +  * WRAPPERS
    +  **********************/
    + struct passwd *
    +-__wrap_prefix_getpwnam(uid_t uid)
    ++__wrap_prefix_getpwnam(uid_t)
    + {
    +     return (struct passwd*) mock();
    + }
    + 
    + int
    +-__wrap_sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions)
    ++__wrap_sd_uid_get_sessions(uid_t, int, char ***)
    + {
    +     return mock();
    + }
     @@ tests/unit/test_logind.c: __wrap_sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions)
      /***********************
       * TEST
 7:  2c35ecdd =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  7f14a1ea =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  78e718c6 =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  d7eec57a = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  7676348e = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  f4410b88 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  b90c5379 = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  13a59bd3 = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  c61824f0 = 15:  dcc1b507 autogen.sh: CFLAGS: Promote -Wall to errors
16:  9c6e635f = 16:  ad0452b9 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  28306b3b = 17:  5747edec lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  5250b7fe = 18:  6b7b17f6 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  0f83b7ef = 19:  b766be5b tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  41740663 = 20:  a0378be6 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  c9f69631 = 21:  cbdbd35f src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  75c89847 = 22:  8ce7e421 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  4549f7fe = 23:  619fb860 tests/unit/test_xasprintf.c: Actually return
24:  cc7683b8 = 24:  6a906023 autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
25:  1cd434f0 = 25:  1a48be1e src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
v13
  • Use specific -Werror=... instead of -Werror=all. This makes sure that the compiler doesn't gratuituously introduce false positives.
  • Fix every error that triggered on my computer with those flags.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  dcc1b507 <  -:  -------- autogen.sh: CFLAGS: Promote -Wall to errors
 -:  -------- > 15:  f284e215 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  ad0452b9 = 16:  197febe5 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  5747edec = 17:  8609ae5b lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  6b7b17f6 = 18:  cadbf344 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  b766be5b = 19:  ae6cac93 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  a0378be6 = 20:  847fde40 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  cbdbd35f = 21:  affd65c8 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  8ce7e421 = 22:  5543a9ac tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  619fb860 = 23:  f85d3cba tests/unit/test_xasprintf.c: Actually return
24:  6a906023 <  -:  -------- autogen.sh: CFLAGS: Avoid -Wyacc errors until we remove that code
25:  1a48be1e = 24:  50500e3d src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
 -:  -------- > 25:  e8033304 lib/: Use '(void)' to define a function with 0 parameters
 -:  -------- > 26:  abd33f24 lib/: addsh(): Add 'short' variant of addsl()
 -:  -------- > 27:  524ba22b lib/failure.c: Use addsh() instead of UB
 -:  -------- > 28:  c7bb40f4 lib/get_pid.c: pid_t is a signed integer
 -:  -------- > 29:  2357e7fc lib/idmapping.c: Fix format specifier for int
 -:  -------- > 30:  cd316add lib/, src/: Use (intmax_t) to print a gid_t/uid_t
 -:  -------- > 31:  d8c4608b lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
 -:  -------- > 32:  cd1f78e4 src/useradd.c: Set 'path' closer to its first use
 -:  -------- > 33:  e42de5e9 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
v13b
  • Fix issues triggered in CI.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  f284e215 ! 15:  763842e8 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=init-self"
      CFLAGS="$CFLAGS -Werror=implicit-int"
     +CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
    -+CFLAGS="$CFLAGS -Werror=hardened"
     +CFLAGS="$CFLAGS -Werror=implicit-fallthrough=5"
     +CFLAGS="$CFLAGS -Werror=if-not-aligned"
     +CFLAGS="$CFLAGS -Werror=ignored-qualifiers"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=parentheses"
     +CFLAGS="$CFLAGS -Werror=sequence-point"
     +CFLAGS="$CFLAGS -Werror=return-local-addr"
    -+CFLAGS="$CFLAGS -Werror=return-mismatch"
     +CFLAGS="$CFLAGS -Werror=return-type"
     +CFLAGS="$CFLAGS -Werror=shift-count-negative"
     +CFLAGS="$CFLAGS -Werror=shift-count-overflow"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=stringop-overread"
     +CFLAGS="$CFLAGS -Werror=stringop-truncation"
     +CFLAGS="$CFLAGS -Werror=suggest-attribute=noreturn"
    -+CFLAGS="$CFLAGS -Werror=alloc-size"
    -+CFLAGS="$CFLAGS -Werror=calloc-transposed-args"
     +CFLAGS="$CFLAGS -Werror=alloc-size-larger-than=20999000"
     +CFLAGS="$CFLAGS -Werror=array-bounds=3"
     +CFLAGS="$CFLAGS -Werror=array-compare"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=cast-align=strict"
     +CFLAGS="$CFLAGS -Werror=cast-function-type"
     +CFLAGS="$CFLAGS -Werror=clobbered"
    -+CFLAGS="$CFLAGS -Werror=compare-distinct-pointer-types"
     +CFLAGS="$CFLAGS -Werror=dangling-pointer=2"
     +CFLAGS="$CFLAGS -Werror=date-time"
     +CFLAGS="$CFLAGS -Werror=empty-body"
     +CFLAGS="$CFLAGS -Werror=enum-compare"
     +CFLAGS="$CFLAGS -Werror=enum-conversion"
    -+CFLAGS="$CFLAGS -Werror=enum-int-mismatch"
     +CFLAGS="$CFLAGS -Werror=jump-misses-init"
     +CFLAGS="$CFLAGS -Werror=sign-compare"
    -+CFLAGS="$CFLAGS -Werror=flex-array-member-not-at-end"
     +CFLAGS="$CFLAGS -Werror=scalar-storage-order"
     +CFLAGS="$CFLAGS -Werror=sizeof-array-div"
     +CFLAGS="$CFLAGS -Werror=sizeof-pointer-div"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=builtin-macro-redefined"
     +CFLAGS="$CFLAGS -Werror=old-style-definition"
     +CFLAGS="$CFLAGS -Werror=missing-parameter-type"
    -+CFLAGS="$CFLAGS -Werror=declaration-missing-parameter-type"
     +CFLAGS="$CFLAGS -Werror=missing-field-initializers"
     +CFLAGS="$CFLAGS -Werror=multichar"
     +CFLAGS="$CFLAGS -Werror=normalized"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=int-to-pointer-cast"
     +CFLAGS="$CFLAGS -Werror=pointer-to-int-cast"
     +CFLAGS="$CFLAGS -Werror=invalid-pch"
    -+CFLAGS="$CFLAGS -Werror=unicode"
     +CFLAGS="$CFLAGS -Werror=varargs"
     +CFLAGS="$CFLAGS -Werror=vla-larger-than=20000"
     +CFLAGS="$CFLAGS -Werror=vla-parameter"
     +CFLAGS="$CFLAGS -Werror=volatile-register-var"
    -+CFLAGS="$CFLAGS -Werror=xor-used-as-pow"
     +CFLAGS="$CFLAGS -Werror=pointer-sign"
     +CFLAGS="$CFLAGS -Werror=overlength-strings"
     +CFLAGS="$CFLAGS -Werror=designated-init"
16:  197febe5 = 16:  c5cf867b lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  8609ae5b = 17:  805617b7 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  cadbf344 = 18:  d5ea83e2 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  ae6cac93 = 19:  f6bef71e tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  847fde40 = 20:  e263ba2d lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  affd65c8 = 21:  fe00bc9d src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  5543a9ac = 22:  841c637a tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  f85d3cba = 23:  a9befd3b tests/unit/test_xasprintf.c: Actually return
24:  50500e3d = 24:  c0cd6f6a src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  e8033304 = 25:  826d05cb lib/: Use '(void)' to define a function with 0 parameters
26:  abd33f24 = 26:  390b755f lib/: addsh(): Add 'short' variant of addsl()
27:  524ba22b = 27:  1080ef77 lib/failure.c: Use addsh() instead of UB
28:  c7bb40f4 = 28:  1eb18292 lib/get_pid.c: pid_t is a signed integer
29:  2357e7fc = 29:  59df9e6a lib/idmapping.c: Fix format specifier for int
30:  cd316add = 30:  6e35afa6 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  d8c4608b = 31:  8fc6e8b2 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  cd1f78e4 = 32:  6e7ebe8a src/useradd.c: Set 'path' closer to its first use
33:  e42de5e9 = 33:  7370f05c src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
v13c
  • Relax -Werror=format-truncation= (false positive).
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  763842e8 ! 15:  18c84729 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=format-overflow=2"
     +CFLAGS="$CFLAGS -Werror=format-security"
     +CFLAGS="$CFLAGS -Werror=format-signedness"
    -+CFLAGS="$CFLAGS -Werror=format-truncation=2"
    ++CFLAGS="$CFLAGS -Werror=format-truncation=1"
     +CFLAGS="$CFLAGS -Werror=nonnull"
     +CFLAGS="$CFLAGS -Werror=nonnull-compare"
     +CFLAGS="$CFLAGS -Werror=null-dereference"
16:  c5cf867b = 16:  5248c865 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  805617b7 = 17:  c1c02bd3 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  d5ea83e2 = 18:  3768dd92 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  f6bef71e = 19:  7a3bb0a7 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  e263ba2d = 20:  dfb25abd lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  fe00bc9d = 21:  da2baa3e src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  841c637a = 22:  253ff21c tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  a9befd3b = 23:  a28d27f4 tests/unit/test_xasprintf.c: Actually return
24:  c0cd6f6a = 24:  8e7e49fd src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  826d05cb = 25:  c10f1092 lib/: Use '(void)' to define a function with 0 parameters
26:  390b755f = 26:  451d8fd0 lib/: addsh(): Add 'short' variant of addsl()
27:  1080ef77 = 27:  46897df8 lib/failure.c: Use addsh() instead of UB
28:  1eb18292 = 28:  030c3856 lib/get_pid.c: pid_t is a signed integer
29:  59df9e6a = 29:  2525eb45 lib/idmapping.c: Fix format specifier for int
30:  6e35afa6 = 30:  00816441 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  8fc6e8b2 = 31:  214677da lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  6e7ebe8a = 32:  1aaf2e3b src/useradd.c: Set 'path' closer to its first use
33:  7370f05c = 33:  35b11ec7 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
v13d
  • Remove -Werror=old-style-definitions, which causes issues with libtool.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  18c84729 ! 15:  1869ae7a autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=attributes"
     +CFLAGS="$CFLAGS -Werror=builtin-declaration-mismatch"
     +CFLAGS="$CFLAGS -Werror=builtin-macro-redefined"
    -+CFLAGS="$CFLAGS -Werror=old-style-definition"
     +CFLAGS="$CFLAGS -Werror=missing-parameter-type"
     +CFLAGS="$CFLAGS -Werror=missing-field-initializers"
     +CFLAGS="$CFLAGS -Werror=multichar"
16:  5248c865 = 16:  0425ca70 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  c1c02bd3 = 17:  f6cad39d lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  3768dd92 = 18:  c5266a5f tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7a3bb0a7 = 19:  4041b70d tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  dfb25abd = 20:  3c853bf7 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  da2baa3e = 21:  91edfb02 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  253ff21c = 22:  431ecebf tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  a28d27f4 = 23:  00760000 tests/unit/test_xasprintf.c: Actually return
24:  8e7e49fd = 24:  0ba98255 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  c10f1092 = 25:  c8917e0b lib/: Use '(void)' to define a function with 0 parameters
26:  451d8fd0 = 26:  eddd1842 lib/: addsh(): Add 'short' variant of addsl()
27:  46897df8 = 27:  4fabe980 lib/failure.c: Use addsh() instead of UB
28:  030c3856 = 28:  010908ed lib/get_pid.c: pid_t is a signed integer
29:  2525eb45 = 29:  69d47d6f lib/idmapping.c: Fix format specifier for int
30:  00816441 = 30:  d1bbc93f lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  214677da = 31:  01421354 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  1aaf2e3b = 32:  9b6bc528 src/useradd.c: Set 'path' closer to its first use
33:  35b11ec7 = 33:  7206c511 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
v14
  • Use [[noreturn]] where possible.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  1869ae7a = 15:  1869ae7a autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  0425ca70 = 16:  0425ca70 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  f6cad39d = 17:  f6cad39d lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  c5266a5f = 18:  c5266a5f tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  4041b70d = 19:  4041b70d tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  3c853bf7 = 20:  3c853bf7 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  91edfb02 = 21:  91edfb02 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  431ecebf = 22:  431ecebf tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  00760000 = 23:  00760000 tests/unit/test_xasprintf.c: Actually return
24:  0ba98255 = 24:  0ba98255 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  c8917e0b = 25:  c8917e0b lib/: Use '(void)' to define a function with 0 parameters
26:  eddd1842 = 26:  eddd1842 lib/: addsh(): Add 'short' variant of addsl()
27:  4fabe980 = 27:  4fabe980 lib/failure.c: Use addsh() instead of UB
28:  010908ed = 28:  010908ed lib/get_pid.c: pid_t is a signed integer
29:  69d47d6f = 29:  69d47d6f lib/idmapping.c: Fix format specifier for int
30:  d1bbc93f = 30:  d1bbc93f lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  01421354 = 31:  01421354 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  9b6bc528 = 32:  9b6bc528 src/useradd.c: Set 'path' closer to its first use
33:  7206c511 = 33:  7206c511 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
 -:  -------- > 34:  b8575b3c tests/unit/test_xasprintf.c: __wrap_exit(): Use [[noreturn]]
v14b
  • Relax -Werror=unused-const-variable, due to lib/pam_defs.h using some weird constant.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  1869ae7a ! 15:  d92de0bc autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=unused-parameter"
     +CFLAGS="$CFLAGS -Werror=unused-result"
     +CFLAGS="$CFLAGS -Werror=unused-variable"
    -+CFLAGS="$CFLAGS -Werror=unused-const-variable=2"
    ++CFLAGS="$CFLAGS -Werror=unused-const-variable=1"
     +CFLAGS="$CFLAGS -Werror=unused-value"
     +CFLAGS="$CFLAGS -Werror=use-after-free=3"
     +CFLAGS="$CFLAGS -Werror=uninitialized"
16:  0425ca70 = 16:  53dec525 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  f6cad39d = 17:  bd128e33 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  c5266a5f = 18:  73aea11b tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  4041b70d = 19:  9862d3dc tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  3c853bf7 = 20:  e52266bb lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  91edfb02 = 21:  57ced330 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  431ecebf = 22:  ddfa2906 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  00760000 = 23:  bb58a3c9 tests/unit/test_xasprintf.c: Actually return
24:  0ba98255 = 24:  76559936 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  c8917e0b = 25:  80d89bec lib/: Use '(void)' to define a function with 0 parameters
26:  eddd1842 = 26:  e4c1f18c lib/: addsh(): Add 'short' variant of addsl()
27:  4fabe980 = 27:  b849669c lib/failure.c: Use addsh() instead of UB
28:  010908ed = 28:  a23356a3 lib/get_pid.c: pid_t is a signed integer
29:  69d47d6f = 29:  b43b1f9d lib/idmapping.c: Fix format specifier for int
30:  d1bbc93f = 30:  e66177d0 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  01421354 = 31:  ab2e0e74 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  9b6bc528 = 32:  9536b236 src/useradd.c: Set 'path' closer to its first use
33:  7206c511 = 33:  526735a6 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  b8575b3c = 34:  97d2fc68 tests/unit/test_xasprintf.c: __wrap_exit(): Use [[noreturn]]
v14c
  • Drop -Werror=redundant-decls (due to bug in musl libc).
  • Drop [[noreturn]] from tests. Since we're testing that it doesn't return, the attribute messes with the tests.
  • Drop the suggestions for noreturn.
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  d92de0bc ! 15:  8417a6a9 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=stringop-overflow=4"
     +CFLAGS="$CFLAGS -Werror=stringop-overread"
     +CFLAGS="$CFLAGS -Werror=stringop-truncation"
    -+CFLAGS="$CFLAGS -Werror=suggest-attribute=noreturn"
     +CFLAGS="$CFLAGS -Werror=alloc-size-larger-than=20999000"
     +CFLAGS="$CFLAGS -Werror=array-bounds=3"
     +CFLAGS="$CFLAGS -Werror=array-compare"
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=packed"
     +CFLAGS="$CFLAGS -Werror=packed-bitfield-compat"
     +CFLAGS="$CFLAGS -Werror=packed-not-aligned"
    -+CFLAGS="$CFLAGS -Werror=redundant-decls"
     +CFLAGS="$CFLAGS -Werror=restrict"
     +CFLAGS="$CFLAGS -Werror=nested-externs"
     +CFLAGS="$CFLAGS -Werror=int-in-bool-context"
16:  53dec525 = 16:  8628db60 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  bd128e33 = 17:  cd34896e lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  73aea11b = 18:  5d1dc9de tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  9862d3dc = 19:  35440237 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  e52266bb = 20:  98853183 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  57ced330 = 21:  370ef37c src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  ddfa2906 = 22:  820e8a74 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  bb58a3c9 = 23:  17f912a1 tests/unit/test_xasprintf.c: Actually return
24:  76559936 = 24:  536a846a src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  80d89bec = 25:  7b44eaaf lib/: Use '(void)' to define a function with 0 parameters
26:  e4c1f18c = 26:  5da6a9f7 lib/: addsh(): Add 'short' variant of addsl()
27:  b849669c = 27:  ffee58b7 lib/failure.c: Use addsh() instead of UB
28:  a23356a3 = 28:  b18fa51c lib/get_pid.c: pid_t is a signed integer
29:  b43b1f9d = 29:  9254385f lib/idmapping.c: Fix format specifier for int
30:  e66177d0 = 30:  b1e2255a lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  ab2e0e74 = 31:  073ac0b6 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  9536b236 = 32:  a1eb0981 src/useradd.c: Set 'path' closer to its first use
33:  526735a6 = 33:  de257885 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  97d2fc68 <  -:  -------- tests/unit/test_xasprintf.c: __wrap_exit(): Use [[noreturn]]
v15
  • Fix typo in rpmatch().
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  8417a6a9 = 15:  8417a6a9 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  8628db60 = 16:  8628db60 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  cd34896e = 17:  cd34896e lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  5d1dc9de = 18:  5d1dc9de tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  35440237 = 19:  35440237 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  98853183 = 20:  98853183 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  370ef37c = 21:  370ef37c src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  820e8a74 = 22:  820e8a74 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  17f912a1 = 23:  17f912a1 tests/unit/test_xasprintf.c: Actually return
24:  536a846a = 24:  536a846a src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  7b44eaaf = 25:  7b44eaaf lib/: Use '(void)' to define a function with 0 parameters
26:  5da6a9f7 = 26:  5da6a9f7 lib/: addsh(): Add 'short' variant of addsl()
27:  ffee58b7 = 27:  ffee58b7 lib/failure.c: Use addsh() instead of UB
28:  b18fa51c = 28:  b18fa51c lib/get_pid.c: pid_t is a signed integer
29:  9254385f = 29:  9254385f lib/idmapping.c: Fix format specifier for int
30:  b1e2255a = 30:  b1e2255a lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  073ac0b6 = 31:  073ac0b6 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  a1eb0981 = 32:  a1eb0981 src/useradd.c: Set 'path' closer to its first use
33:  de257885 = 33:  de257885 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
 -:  -------- > 34:  ef58c50e lib/yesno.c: rpmatch(): Fix typo
v15b
  • Drop -Werror=bad-function-cast, since we need to do such casts with mock().
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  8417a6a9 ! 15:  125c3a9c autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=comment"
     +CFLAGS="$CFLAGS -Werror=trigraphs"
     +CFLAGS="$CFLAGS -Werror=endif-labels"
    -+CFLAGS="$CFLAGS -Werror=bad-function-cast"
     +CFLAGS="$CFLAGS -Werror=cast-align=strict"
     +CFLAGS="$CFLAGS -Werror=cast-function-type"
     +CFLAGS="$CFLAGS -Werror=clobbered"
16:  8628db60 = 16:  64978177 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  cd34896e = 17:  e9fbfc00 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  5d1dc9de = 18:  c741e59d tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  35440237 = 19:  358eb207 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  98853183 = 20:  fb495f4c lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  370ef37c = 21:  4ab1f4b1 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  820e8a74 = 22:  1233a1f7 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  17f912a1 = 23:  822c071e tests/unit/test_xasprintf.c: Actually return
24:  536a846a = 24:  d9153b2d src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  7b44eaaf = 25:  ce1a0bbd lib/: Use '(void)' to define a function with 0 parameters
26:  5da6a9f7 = 26:  66121568 lib/: addsh(): Add 'short' variant of addsl()
27:  ffee58b7 = 27:  f45ddb54 lib/failure.c: Use addsh() instead of UB
28:  b18fa51c = 28:  87c02add lib/get_pid.c: pid_t is a signed integer
29:  9254385f = 29:  031afa98 lib/idmapping.c: Fix format specifier for int
30:  b1e2255a = 30:  de69cdad lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  073ac0b6 = 31:  6a2797d3 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  a1eb0981 = 32:  876f269f src/useradd.c: Set 'path' closer to its first use
33:  de257885 = 33:  d08b0108 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  ef58c50e = 34:  cd2673a8 lib/yesno.c: rpmatch(): Fix typo
v16
  • Turn off -Werror=stringop-overread, as it has bogus reports with strncat(3).
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  125c3a9c ! 15:  539611c3 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=strict-overflow=5"
     +CFLAGS="$CFLAGS -Werror=string-compare"
     +CFLAGS="$CFLAGS -Werror=stringop-overflow=4"
    -+CFLAGS="$CFLAGS -Werror=stringop-overread"
     +CFLAGS="$CFLAGS -Werror=stringop-truncation"
     +CFLAGS="$CFLAGS -Werror=alloc-size-larger-than=20999000"
     +CFLAGS="$CFLAGS -Werror=array-bounds=3"
16:  64978177 = 16:  7677b3cf lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  e9fbfc00 = 17:  f8aaaddf lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  c741e59d = 18:  b3544951 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  358eb207 = 19:  9ccf9500 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  fb495f4c = 20:  88e381a6 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  4ab1f4b1 = 21:  51abbbdd src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  1233a1f7 = 22:  54065d1c tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  822c071e = 23:  0ea024d6 tests/unit/test_xasprintf.c: Actually return
24:  d9153b2d = 24:  778d4905 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  ce1a0bbd = 25:  1e35e68e lib/: Use '(void)' to define a function with 0 parameters
26:  66121568 = 26:  4a48a43d lib/: addsh(): Add 'short' variant of addsl()
27:  f45ddb54 = 27:  2ac4846e lib/failure.c: Use addsh() instead of UB
28:  87c02add = 28:  8e0bc955 lib/get_pid.c: pid_t is a signed integer
29:  031afa98 = 29:  9211953c lib/idmapping.c: Fix format specifier for int
30:  de69cdad = 30:  dc642852 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  6a2797d3 = 31:  1e56f997 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  876f269f = 32:  21db1c29 src/useradd.c: Set 'path' closer to its first use
33:  d08b0108 = 33:  3849e704 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  cd2673a8 = 34:  2c629207 lib/yesno.c: rpmatch(): Fix typo
v17
  • Drop -Werror=unused-result, as it opens a can of worms that needs careful investigation.
$ git range-diff master 2c62920 c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  539611c3 ! 15:  e33588a2 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=unused-label"
     +CFLAGS="$CFLAGS -Werror=unused-local-typedefs"
     +CFLAGS="$CFLAGS -Werror=unused-parameter"
    -+CFLAGS="$CFLAGS -Werror=unused-result"
     +CFLAGS="$CFLAGS -Werror=unused-variable"
     +CFLAGS="$CFLAGS -Werror=unused-const-variable=1"
     +CFLAGS="$CFLAGS -Werror=unused-value"
16:  7677b3cf = 16:  ed76909f lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  f8aaaddf = 17:  6dd490ab lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  b3544951 = 18:  e956e89b tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  9ccf9500 = 19:  b616c629 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  88e381a6 = 20:  9bc3016b lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  51abbbdd = 21:  ea582f27 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  54065d1c = 22:  bef98cce tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  0ea024d6 = 23:  0199c2d2 tests/unit/test_xasprintf.c: Actually return
24:  778d4905 = 24:  4a434237 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  1e35e68e = 25:  d162b2ca lib/: Use '(void)' to define a function with 0 parameters
26:  4a48a43d = 26:  90da5413 lib/: addsh(): Add 'short' variant of addsl()
27:  2ac4846e = 27:  cffc0193 lib/failure.c: Use addsh() instead of UB
28:  8e0bc955 = 28:  d51f0aae lib/get_pid.c: pid_t is a signed integer
29:  9211953c = 29:  30e01f48 lib/idmapping.c: Fix format specifier for int
30:  dc642852 = 30:  e9c73079 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  1e56f997 = 31:  8c867910 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  21db1c29 = 32:  9e9d4dc8 src/useradd.c: Set 'path' closer to its first use
33:  3849e704 = 33:  d1bdf15b src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  2c629207 = 34:  c868f7e6 lib/yesno.c: rpmatch(): Fix typo
v18
$ git range-diff master gh/c c
 1:  5ba2ba92 =  1:  5ba2ba92 lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  d6e71302 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  5de673ed lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  f0dfbb85 src/: Unname unused parameter of main()
 5:  a932f31b =  5:  a932f31b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  6c41446d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d =  7:  5e32945d lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  6d9da5db lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  f31cd3ea lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  19cc48c1 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  8871b915 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  e7aecd76 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  2d2fdb8e lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  61f970cb lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  e33588a2 = 15:  e33588a2 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  ed76909f = 16:  ed76909f lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  6dd490ab = 17:  6dd490ab lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  e956e89b = 18:  e956e89b tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  b616c629 = 19:  b616c629 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  9bc3016b = 20:  9bc3016b lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  ea582f27 = 21:  ea582f27 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  bef98cce = 22:  bef98cce tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  0199c2d2 = 23:  0199c2d2 tests/unit/test_xasprintf.c: Actually return
24:  4a434237 = 24:  4a434237 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  d162b2ca = 25:  d162b2ca lib/: Use '(void)' to define a function with 0 parameters
26:  90da5413 = 26:  90da5413 lib/: addsh(): Add 'short' variant of addsl()
27:  cffc0193 = 27:  cffc0193 lib/failure.c: Use addsh() instead of UB
28:  d51f0aae = 28:  d51f0aae lib/get_pid.c: pid_t is a signed integer
29:  30e01f48 = 29:  30e01f48 lib/idmapping.c: Fix format specifier for int
30:  e9c73079 = 30:  e9c73079 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  8c867910 = 31:  8c867910 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  9e9d4dc8 = 32:  9e9d4dc8 src/useradd.c: Set 'path' closer to its first use
33:  d1bdf15b = 33:  d1bdf15b src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  c868f7e6 = 34:  c868f7e6 lib/yesno.c: rpmatch(): Fix typo
 -:  -------- > 35:  61aa9757 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19
  • Rebase
$ git range-diff master..gh/c shadow/master..c
 1:  5ba2ba92 =  1:  a41b83fa lib/string/strspn/: Add missing const
 2:  d6e71302 =  2:  920fc9f3 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  5de673ed =  3:  0905ac2b lib/, src/: Remove unused variables
 4:  f0dfbb85 =  4:  55748c3c src/: Unname unused parameter of main()
 5:  a932f31b =  5:  e79ce6f0 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  6c41446d =  6:  8fb0de6c lib/, src/ tests/: Unname unused parameters in callbacks
 7:  5e32945d <  -:  -------- lib/, src/: Remove unused parameter $2 of audit_logger()
 -:  -------- >  7:  0d884e3e lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6d9da5db =  8:  f8129b23 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f31cd3ea =  9:  7fb847d7 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  19cc48c1 = 10:  5f123636 lib/logind.c: Unname unused function parameter
11:  8871b915 = 11:  e949d2e0 lib/: Remove unused parameter $3 of password_check() and propagate
12:  e7aecd76 = 12:  f02de7ba lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2d2fdb8e = 13:  f17fa48c lib/, src/: Remove unused parameter $3 of passwd_check()
14:  61f970cb = 14:  190f2729 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  e33588a2 = 15:  648b45ac autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  ed76909f = 16:  d096bc2c lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  6dd490ab = 17:  7a16ff93 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  e956e89b = 18:  7c0f4027 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  b616c629 = 19:  59662eaa tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  9bc3016b = 20:  b0005816 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  ea582f27 = 21:  095e1ce3 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  bef98cce = 22:  949c9838 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  0199c2d2 = 23:  3e184633 tests/unit/test_xasprintf.c: Actually return
24:  4a434237 = 24:  76ee2bd0 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  d162b2ca = 25:  9a4eade4 lib/: Use '(void)' to define a function with 0 parameters
26:  90da5413 = 26:  554e5e54 lib/: addsh(): Add 'short' variant of addsl()
27:  cffc0193 = 27:  32ec795e lib/failure.c: Use addsh() instead of UB
28:  d51f0aae = 28:  ded9ae3d lib/get_pid.c: pid_t is a signed integer
29:  30e01f48 = 29:  b5e25c43 lib/idmapping.c: Fix format specifier for int
30:  e9c73079 ! 30:  17a6085d lib/, src/: Use (intmax_t) to print a gid_t/uid_t
    @@ src/usermod.c
      #include <strings.h>
      #include <sys/stat.h>
     @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    -                         "changing uid", user_newname, user_newid, 1);
    +                         "changing-uid", user_newname, user_newid, 1);
      #endif
                SYSLOG ((LOG_INFO,
     -                   "change user '%s' UID from '%d' to '%d'",
31:  8c867910 = 31:  7381a3af lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  9e9d4dc8 = 32:  22be39be src/useradd.c: Set 'path' closer to its first use
33:  d1bdf15b ! 33:  68d88d5c src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
    @@ src/useradd.c: static void create_home (void)
     +  free(path);
        home_added = true;
      #ifdef WITH_AUDIT
    -   audit_logger(AUDIT_ADD_USER, "adding home directory",
    +   audit_logger(AUDIT_USER_MGMT, "add-home-dir",
34:  c868f7e6 = 34:  c3f2a006 lib/yesno.c: rpmatch(): Fix typo
35:  61aa9757 = 35:  8e574285 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19b
$ git range-diff master gh/c c
 1:  a41b83fa =  1:  a41b83fa lib/string/strspn/: Add missing const
 2:  920fc9f3 =  2:  920fc9f3 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  0905ac2b =  3:  0905ac2b lib/, src/: Remove unused variables
 4:  55748c3c =  4:  55748c3c src/: Unname unused parameter of main()
 5:  e79ce6f0 =  5:  e79ce6f0 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  8fb0de6c =  6:  8fb0de6c lib/, src/ tests/: Unname unused parameters in callbacks
 7:  0d884e3e !  7:  23505e6b lib/, src/: Remove unused parameter $2 of audit_logger()
    @@ src/chage.c: int main (int argc, char **argv)
                }
     
      ## src/groupadd.c ##
    +@@ src/groupadd.c: usage (int status)
    + static void fail_exit(int status)
    + {
    + #ifdef WITH_AUDIT
    +-  audit_logger(AUDIT_ADD_GROUP, Prog, "add-group", group_name,
    ++  audit_logger(AUDIT_ADD_GROUP, "add-group", group_name,
    +                            AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
    + #endif
    +   exit (status);
     @@ src/groupadd.c: static void close_files (void)
                fail_exit (E_GRP_UPDATE);
        }
    @@ src/groupadd.c: static void close_files (void)
      #endif
     
      ## src/groupdel.c ##
    +@@ src/groupdel.c: usage (int status)
    + static void fail_exit(int status)
    + {
    + #ifdef WITH_AUDIT
    +-  audit_logger(AUDIT_GRP_MGMT, Prog, "delete-group", group_name,
    ++  audit_logger(AUDIT_GRP_MGMT, "delete-group", group_name,
    +                         AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
    + #endif
    +   exit (status);
     @@ src/groupdel.c: static void close_files (void)
        }
      
 8:  f8129b23 =  8:  3ce7bfb2 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  7fb847d7 =  9:  f9e7d29e lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  5f123636 = 10:  7f7b08d6 lib/logind.c: Unname unused function parameter
11:  e949d2e0 = 11:  118adec5 lib/: Remove unused parameter $3 of password_check() and propagate
12:  f02de7ba = 12:  90d8fb6f lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  f17fa48c = 13:  78184515 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  190f2729 = 14:  70ddebb0 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  648b45ac = 15:  ff337232 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  d096bc2c = 16:  03e902f8 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  7a16ff93 = 17:  2453bdd5 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  7c0f4027 = 18:  3da0ead7 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  59662eaa = 19:  f08eb5ab tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  b0005816 = 20:  3a91aa31 lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  095e1ce3 = 21:  0deda720 src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  949c9838 = 22:  754f47a9 tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  3e184633 = 23:  fdcef5db tests/unit/test_xasprintf.c: Actually return
24:  76ee2bd0 = 24:  33034498 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  9a4eade4 = 25:  b2c80e5d lib/: Use '(void)' to define a function with 0 parameters
26:  554e5e54 = 26:  d014fbbe lib/: addsh(): Add 'short' variant of addsl()
27:  32ec795e = 27:  4e47a190 lib/failure.c: Use addsh() instead of UB
28:  ded9ae3d = 28:  08da55e5 lib/get_pid.c: pid_t is a signed integer
29:  b5e25c43 = 29:  13aad4fe lib/idmapping.c: Fix format specifier for int
30:  17a6085d = 30:  e084c5c9 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  7381a3af = 31:  ba3f840b lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  22be39be = 32:  6f59c708 src/useradd.c: Set 'path' closer to its first use
33:  68d88d5c = 33:  cad24be1 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  c3f2a006 = 34:  2b8e9bdc lib/yesno.c: rpmatch(): Fix typo
35:  8e574285 = 35:  b628fdf4 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19c
  • Rebase
$ git rd
 1:  a41b83fa =  1:  baf0a8e1 lib/string/strspn/: Add missing const
 2:  920fc9f3 =  2:  6b1bec67 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  0905ac2b =  3:  f267b213 lib/, src/: Remove unused variables
 4:  55748c3c =  4:  9cf868d7 src/: Unname unused parameter of main()
 5:  e79ce6f0 =  5:  e60af25f src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  8fb0de6c =  6:  f32455fe lib/, src/ tests/: Unname unused parameters in callbacks
 7:  23505e6b =  7:  dd2cca51 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  3ce7bfb2 =  8:  b527e13b lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f9e7d29e =  9:  1258b3d7 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  7f7b08d6 = 10:  dba90ea7 lib/logind.c: Unname unused function parameter
11:  118adec5 = 11:  17fae57a lib/: Remove unused parameter $3 of password_check() and propagate
12:  90d8fb6f = 12:  ba9da35c lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  78184515 = 13:  aed38d7a lib/, src/: Remove unused parameter $3 of passwd_check()
14:  70ddebb0 = 14:  097ec118 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  ff337232 ! 15:  674598be autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
     +CFLAGS="$CFLAGS -Werror=enum-compare"
     +CFLAGS="$CFLAGS -Werror=enum-conversion"
     +CFLAGS="$CFLAGS -Werror=jump-misses-init"
    -+CFLAGS="$CFLAGS -Werror=sign-compare"
    + CFLAGS="$CFLAGS -Werror=sign-compare"
     +CFLAGS="$CFLAGS -Werror=scalar-storage-order"
     +CFLAGS="$CFLAGS -Werror=sizeof-array-div"
     +CFLAGS="$CFLAGS -Werror=sizeof-pointer-div"
16:  03e902f8 = 16:  cb14be3e lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  2453bdd5 = 17:  7c847901 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  3da0ead7 = 18:  bd41821c tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  f08eb5ab = 19:  f660f7cb tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  3a91aa31 <  -:  -------- lib/sizeof.h: ssizeof(): Add signed variant of sizeof
21:  0deda720 <  -:  -------- src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
22:  754f47a9 <  -:  -------- tests/unit/test_xasprintf.c: Fix sign-mismatch diagnostic
23:  fdcef5db = 20:  1a0263ff tests/unit/test_xasprintf.c: Actually return
24:  33034498 = 21:  b80730c0 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
25:  b2c80e5d = 22:  90b0481f lib/: Use '(void)' to define a function with 0 parameters
26:  d014fbbe = 23:  476e3a4a lib/: addsh(): Add 'short' variant of addsl()
27:  4e47a190 = 24:  6edcc3ae lib/failure.c: Use addsh() instead of UB
28:  08da55e5 = 25:  78b2ee78 lib/get_pid.c: pid_t is a signed integer
29:  13aad4fe = 26:  27e39a13 lib/idmapping.c: Fix format specifier for int
30:  e084c5c9 = 27:  bc1ace3f lib/, src/: Use (intmax_t) to print a gid_t/uid_t
31:  ba3f840b = 28:  e5b67f1e lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
32:  6f59c708 = 29:  0b22fe0b src/useradd.c: Set 'path' closer to its first use
33:  cad24be1 = 30:  5ad21185 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
34:  2b8e9bdc = 31:  c1edebf8 lib/yesno.c: rpmatch(): Fix typo
35:  b628fdf4 = 32:  c016311d lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19d
  • Rebase
$ git range-diff db/master..gh/c shadow/master..c
 1:  baf0a8e1 =  1:  e5cc3440 lib/string/strspn/: Add missing const
 2:  6b1bec67 =  2:  73a49115 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  f267b213 =  3:  03325d42 lib/, src/: Remove unused variables
 4:  9cf868d7 =  4:  237eb86b src/: Unname unused parameter of main()
 5:  e60af25f =  5:  5eba8530 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  f32455fe =  6:  7dff36e1 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  dd2cca51 =  7:  0713070b lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  b527e13b =  8:  53c90668 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  1258b3d7 =  9:  cdf74996 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  dba90ea7 = 10:  ecf17df5 lib/logind.c: Unname unused function parameter
11:  17fae57a = 11:  3e89bf40 lib/: Remove unused parameter $3 of password_check() and propagate
12:  ba9da35c = 12:  5a51b9e0 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  aed38d7a = 13:  2a3cb4cb lib/, src/: Remove unused parameter $3 of passwd_check()
14:  097ec118 = 14:  0a9f6031 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  674598be = 15:  fdbe70ac autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  cb14be3e = 16:  23d38ba1 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  7c847901 = 17:  ef48ab46 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  bd41821c = 18:  a8d74c3a tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  f660f7cb = 19:  5cebcb30 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1a0263ff = 20:  b7fa310b tests/unit/test_xasprintf.c: Actually return
21:  b80730c0 = 21:  814686bf src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  90b0481f = 22:  245cb764 lib/: Use '(void)' to define a function with 0 parameters
23:  476e3a4a = 23:  f8d9e277 lib/: addsh(): Add 'short' variant of addsl()
24:  6edcc3ae = 24:  ff859106 lib/failure.c: Use addsh() instead of UB
25:  78b2ee78 = 25:  9b66966e lib/get_pid.c: pid_t is a signed integer
26:  27e39a13 = 26:  5eb54dbb lib/idmapping.c: Fix format specifier for int
27:  bc1ace3f = 27:  a8e25ada lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  e5b67f1e = 28:  b14ce3cc lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  0b22fe0b = 29:  5b69bb91 src/useradd.c: Set 'path' closer to its first use
30:  5ad21185 = 30:  db088a9f src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  c1edebf8 = 31:  4f0aec0d lib/yesno.c: rpmatch(): Fix typo
32:  c016311d = 32:  98aeb916 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19e
  • Rebase
$ git rd
 1:  e5cc3440 =  1:  75263ff4 lib/string/strspn/: Add missing const
 2:  73a49115 =  2:  5439920b autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  03325d42 =  3:  fa75ac76 lib/, src/: Remove unused variables
 4:  237eb86b =  4:  85a95843 src/: Unname unused parameter of main()
 5:  5eba8530 =  5:  1039bb3b src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  7dff36e1 =  6:  d015e9c7 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  0713070b =  7:  98d08c94 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  53c90668 =  8:  cee2a63d lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  cdf74996 =  9:  913eb795 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  ecf17df5 = 10:  35327741 lib/logind.c: Unname unused function parameter
11:  3e89bf40 = 11:  aeb8efb1 lib/: Remove unused parameter $3 of password_check() and propagate
12:  5a51b9e0 = 12:  3bf1ce38 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  2a3cb4cb = 13:  450f051a lib/, src/: Remove unused parameter $3 of passwd_check()
14:  0a9f6031 = 14:  cf4499fe lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  fdbe70ac = 15:  3f5b9161 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  23d38ba1 = 16:  6420415c lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  ef48ab46 = 17:  e94e16f9 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  a8d74c3a = 18:  169f96cf tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  5cebcb30 = 19:  a875a670 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  b7fa310b = 20:  f070deef tests/unit/test_xasprintf.c: Actually return
21:  814686bf = 21:  eb5114d8 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  245cb764 = 22:  ab327c7e lib/: Use '(void)' to define a function with 0 parameters
23:  f8d9e277 = 23:  6abd98a3 lib/: addsh(): Add 'short' variant of addsl()
24:  ff859106 = 24:  77008130 lib/failure.c: Use addsh() instead of UB
25:  9b66966e = 25:  f0da2fe2 lib/get_pid.c: pid_t is a signed integer
26:  5eb54dbb = 26:  1a6e1042 lib/idmapping.c: Fix format specifier for int
27:  a8e25ada = 27:  72ae6203 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  b14ce3cc = 28:  974efddf lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  5b69bb91 = 29:  e5460d12 src/useradd.c: Set 'path' closer to its first use
30:  db088a9f = 30:  72681c9e src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  4f0aec0d = 31:  c547a9c7 lib/yesno.c: rpmatch(): Fix typo
32:  98aeb916 = 32:  2d033e41 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19f
  • Rebase
$ git rd
 1:  75263ff4 =  1:  3c65f5b3 lib/string/strspn/: Add missing const
 2:  5439920b =  2:  09a827bf autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  fa75ac76 =  3:  9b93bc0a lib/, src/: Remove unused variables
 4:  85a95843 =  4:  eb2c487b src/: Unname unused parameter of main()
 5:  1039bb3b =  5:  dfb36341 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d015e9c7 =  6:  a5eceb84 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  98d08c94 =  7:  83afb430 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  cee2a63d =  8:  e0588d51 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  913eb795 =  9:  f2587b44 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  35327741 = 10:  167f5f8d lib/logind.c: Unname unused function parameter
11:  aeb8efb1 = 11:  5d365810 lib/: Remove unused parameter $3 of password_check() and propagate
12:  3bf1ce38 = 12:  db050b56 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  450f051a = 13:  a4ea7d0a lib/, src/: Remove unused parameter $3 of passwd_check()
14:  cf4499fe = 14:  2ac3dd9a lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  3f5b9161 = 15:  374ee223 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  6420415c = 16:  a7dedafd lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  e94e16f9 = 17:  8c6c107e lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  169f96cf = 18:  00b11c82 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  a875a670 = 19:  75a6db8b tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  f070deef = 20:  72c527da tests/unit/test_xasprintf.c: Actually return
21:  eb5114d8 ! 21:  e2d5a7f1 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
    @@ src/login.c: static /*@observer@*/const char *get_failent_user (/*@returned@*/co
        char           *host = NULL;
        char           tty[BUFSIZ];
     @@ src/login.c: int main (int argc, char **argv)
    -   if (pwd->pw_shell[0] == '*') {  /* subsystem root */
    +   if (strprefix(pwd->pw_shell, "*")) {  /* subsystem root */
                pwd->pw_shell++;        /* skip the '*' */
                subsystem (pwd);        /* figure out what to execute */
     +#if !defined(USE_PAM)
22:  ab327c7e = 22:  23a65a81 lib/: Use '(void)' to define a function with 0 parameters
23:  6abd98a3 = 23:  9602379e lib/: addsh(): Add 'short' variant of addsl()
24:  77008130 = 24:  69de8a3d lib/failure.c: Use addsh() instead of UB
25:  f0da2fe2 = 25:  54e5a0f7 lib/get_pid.c: pid_t is a signed integer
26:  1a6e1042 = 26:  a7cd2f2f lib/idmapping.c: Fix format specifier for int
27:  72ae6203 = 27:  1deae7fa lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  974efddf = 28:  fed031ab lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  e5460d12 ! 29:  1274d7fb src/useradd.c: Set 'path' closer to its first use
    @@ src/useradd.c: static void create_home (void)
     +  strcpy(path, "");
        for (cp = strtok(bhome, "/"); cp != NULL; cp = strtok(NULL, "/")) {
                /* Avoid turning a relative path into an absolute path. */
    -           if (bhome[0] == '/' || !streq(path, ""))
    +           if (strprefix(bhome, "/") || !streq(path, ""))
30:  72681c9e ! 30:  ae545c6d src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
    @@ src/useradd.c: static void create_home (void)
     +
        for (cp = strtok(bhome, "/"); cp != NULL; cp = strtok(NULL, "/")) {
                /* Avoid turning a relative path into an absolute path. */
    -           if (bhome[0] == '/' || !streq(path, ""))
    +           if (strprefix(bhome, "/") || !streq(path, ""))
     @@ src/useradd.c: static void create_home (void)
                fprintf(stderr, _("%s: warning: chown on '%s' failed: %m\n"),
                        Prog, path);
31:  c547a9c7 <  -:  -------- lib/yesno.c: rpmatch(): Fix typo
32:  2d033e41 = 31:  ac4717c5 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19g
  • Rebase
$ git rd
 1:  3c65f5b3 =  1:  e919b0b4 lib/string/strspn/: Add missing const
 2:  09a827bf =  2:  cb5af445 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  9b93bc0a =  3:  8465d4cc lib/, src/: Remove unused variables
 4:  eb2c487b =  4:  88fcb65e src/: Unname unused parameter of main()
 5:  dfb36341 =  5:  6ab3fe30 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  a5eceb84 =  6:  66a97bd5 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  83afb430 =  7:  8820e7dc lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  e0588d51 =  8:  ffde881b lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  f2587b44 =  9:  19437933 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  167f5f8d = 10:  a79cca08 lib/logind.c: Unname unused function parameter
11:  5d365810 = 11:  74e049d8 lib/: Remove unused parameter $3 of password_check() and propagate
12:  db050b56 = 12:  33d0492b lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  a4ea7d0a = 13:  fa27d33a lib/, src/: Remove unused parameter $3 of passwd_check()
14:  2ac3dd9a = 14:  3c7141e5 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  374ee223 = 15:  137d8fb3 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  a7dedafd = 16:  de63a8b0 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  8c6c107e = 17:  c776eb11 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  00b11c82 = 18:  3d9dee94 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  75a6db8b = 19:  7592a2ec tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  72c527da = 20:  3f539db8 tests/unit/test_xasprintf.c: Actually return
21:  e2d5a7f1 = 21:  776c78d9 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  23a65a81 = 22:  02f27bfd lib/: Use '(void)' to define a function with 0 parameters
23:  9602379e = 23:  9f4b7f51 lib/: addsh(): Add 'short' variant of addsl()
24:  69de8a3d = 24:  ce23f1b1 lib/failure.c: Use addsh() instead of UB
25:  54e5a0f7 = 25:  96bcb27b lib/get_pid.c: pid_t is a signed integer
26:  a7cd2f2f = 26:  0df794e6 lib/idmapping.c: Fix format specifier for int
27:  1deae7fa = 27:  4b77ede2 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  fed031ab = 28:  bb403c5e lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  1274d7fb = 29:  57cd2e27 src/useradd.c: Set 'path' closer to its first use
30:  ae545c6d = 30:  fd887faf src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  ac4717c5 = 31:  295f1eef lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19h
  • Rebase
$ git rd
 1:  e919b0b4 =  1:  cdeec442 lib/string/strspn/: Add missing const
 2:  cb5af445 =  2:  c071f100 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  8465d4cc =  3:  f507df30 lib/, src/: Remove unused variables
 4:  88fcb65e =  4:  ea078a85 src/: Unname unused parameter of main()
 5:  6ab3fe30 =  5:  d851f6b0 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  66a97bd5 =  6:  b2ce250d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  8820e7dc =  7:  16d4c2a7 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  ffde881b =  8:  fb7c34fe lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  19437933 =  9:  d0a9b765 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  a79cca08 = 10:  4622fbfd lib/logind.c: Unname unused function parameter
11:  74e049d8 ! 11:  4efa6d53 lib/: Remove unused parameter $3 of password_check() and propagate
    @@ Commit message
         Signed-off-by: Alejandro Colomar <[email protected]>
     
      ## lib/obscure.c ##
    -@@ lib/obscure.c: static char *str_lower (/*@returned@*/char *string)
    +@@ lib/obscure.c: static bool similar (/*@notnull@*/const char *old, /*@notnull@*/const char *new)
      
      static /*@observer@*//*@null@*/const char *password_check (
        /*@notnull@*/const char *old,
12:  33d0492b ! 12:  08100c4a lib/obscure.c: Remove unused parameter $1 of palindrome()
    @@ lib/obscure.c
        size_t i, j;
      
     @@ lib/obscure.c: static /*@observer@*//*@null@*/const char *password_check (
    -   oldmono = str_lower (xstrdup (old));
    +   oldmono = strtolower(xstrdup(old));
        xasprintf(&wrapped, "%s%s", oldmono, oldmono);
      
     -  if (palindrome (oldmono, newmono)) {
13:  fa27d33a = 13:  1b6ac783 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  3c7141e5 ! 14:  a88ed044 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
    @@ src/newusers.c
     @@
      #include "alloc/reallocf.h"
      #include "atoi/getnum.h"
    - #include "atoi/str2i/str2s.h"
    + #include "atoi/str2i.h"
     +#include "attr.h"
      #ifdef ACCT_TOOLS_SETUID
      #ifdef USE_PAM
15:  137d8fb3 = 15:  625299d5 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  de63a8b0 = 16:  7a0a219d lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  c776eb11 = 17:  cdfe93ba lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  3d9dee94 = 18:  1596f884 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7592a2ec = 19:  7e588add tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  3f539db8 = 20:  1b2d1715 tests/unit/test_xasprintf.c: Actually return
21:  776c78d9 = 21:  b7f721a1 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  02f27bfd = 22:  0cf61ab9 lib/: Use '(void)' to define a function with 0 parameters
23:  9f4b7f51 = 23:  f77a3bb5 lib/: addsh(): Add 'short' variant of addsl()
24:  ce23f1b1 = 24:  2ad66e7f lib/failure.c: Use addsh() instead of UB
25:  96bcb27b = 25:  d8551ddf lib/get_pid.c: pid_t is a signed integer
26:  0df794e6 = 26:  eb57a77b lib/idmapping.c: Fix format specifier for int
27:  4b77ede2 = 27:  d476ae6c lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  bb403c5e ! 28:  f3bea61f lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
    @@ Commit message
     
      ## lib/subordinateio.c ##
     @@
    - #include "alloc/malloc.h"
      #include "alloc/realloc.h"
      #include "alloc/reallocf.h"
    + #include "atoi/str2i.h"
     +#include "atoi/getnum.h"
    - #include "atoi/str2i/str2u.h"
      #include "string/ctype/strisascii/strisdigit.h"
      #include "string/sprintf/snprintf.h"
    + #include "string/strcmp/streq.h"
     @@ lib/subordinateio.c: static int append_uids(uid_t **uids, const char *owner, int n)
        uid_t  owner_uid;
      
29:  57cd2e27 = 29:  3c7b0238 src/useradd.c: Set 'path' closer to its first use
30:  fd887faf = 30:  0197cb4d src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  295f1eef = 31:  3e717b41 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19i
  • Rebase
$ git rd
 1:  cdeec442 =  1:  0143b2a1 lib/string/strspn/: Add missing const
 2:  c071f100 =  2:  acdb1556 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  f507df30 =  3:  a77f2889 lib/, src/: Remove unused variables
 4:  ea078a85 =  4:  6f9c2175 src/: Unname unused parameter of main()
 5:  d851f6b0 =  5:  717fd8ad src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  b2ce250d =  6:  257e4ef0 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  16d4c2a7 =  7:  9d14ca33 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  fb7c34fe =  8:  c5a3aecc lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  d0a9b765 =  9:  6fe509e3 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  4622fbfd = 10:  383468eb lib/logind.c: Unname unused function parameter
11:  4efa6d53 = 11:  ab287962 lib/: Remove unused parameter $3 of password_check() and propagate
12:  08100c4a = 12:  9aea47d1 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  1b6ac783 = 13:  d7b6e7e2 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  a88ed044 = 14:  1b9eaee2 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  625299d5 = 15:  1d74043b autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  7a0a219d = 16:  c6fcedb5 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  cdfe93ba = 17:  18afc7e9 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  1596f884 = 18:  4e9e2fea tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7e588add = 19:  52b2db48 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  1b2d1715 = 20:  40988491 tests/unit/test_xasprintf.c: Actually return
21:  b7f721a1 = 21:  e4fffe45 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  0cf61ab9 = 22:  b043f7d3 lib/: Use '(void)' to define a function with 0 parameters
23:  f77a3bb5 = 23:  29454803 lib/: addsh(): Add 'short' variant of addsl()
24:  2ad66e7f = 24:  949b46c7 lib/failure.c: Use addsh() instead of UB
25:  d8551ddf = 25:  f7c83057 lib/get_pid.c: pid_t is a signed integer
26:  eb57a77b = 26:  333b73c3 lib/idmapping.c: Fix format specifier for int
27:  d476ae6c = 27:  388f46c9 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  f3bea61f = 28:  2698f126 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  3c7b0238 = 29:  1519afe8 src/useradd.c: Set 'path' closer to its first use
30:  0197cb4d = 30:  03668bb4 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  3e717b41 = 31:  a12847fb lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19j
  • Rebase
$ git rd
 1:  0143b2a1 =  1:  142670d2 lib/string/strspn/: Add missing const
 2:  acdb1556 =  2:  ebe529e3 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  a77f2889 =  3:  97d63e69 lib/, src/: Remove unused variables
 4:  6f9c2175 =  4:  3634e877 src/: Unname unused parameter of main()
 5:  717fd8ad =  5:  7be6d419 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  257e4ef0 =  6:  ef308a5d lib/, src/ tests/: Unname unused parameters in callbacks
 7:  9d14ca33 =  7:  b37738f5 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  c5a3aecc =  8:  3579b9ea lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  6fe509e3 =  9:  41791d05 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  383468eb = 10:  bc0027d0 lib/logind.c: Unname unused function parameter
11:  ab287962 = 11:  762b66c4 lib/: Remove unused parameter $3 of password_check() and propagate
12:  9aea47d1 = 12:  ed0ffa9f lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  d7b6e7e2 = 13:  50787bcf lib/, src/: Remove unused parameter $3 of passwd_check()
14:  1b9eaee2 = 14:  ffd23ae3 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  1d74043b = 15:  57ced830 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  c6fcedb5 = 16:  cf3e98b4 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  18afc7e9 = 17:  00c38aae lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  4e9e2fea = 18:  c9aedf8f tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  52b2db48 = 19:  a361c824 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  40988491 = 20:  c27b6851 tests/unit/test_xasprintf.c: Actually return
21:  e4fffe45 = 21:  3ed32429 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  b043f7d3 = 22:  ee82a8c8 lib/: Use '(void)' to define a function with 0 parameters
23:  29454803 = 23:  8e671c6a lib/: addsh(): Add 'short' variant of addsl()
24:  949b46c7 = 24:  2c6b10fb lib/failure.c: Use addsh() instead of UB
25:  f7c83057 = 25:  4aee8900 lib/get_pid.c: pid_t is a signed integer
26:  333b73c3 = 26:  56549138 lib/idmapping.c: Fix format specifier for int
27:  388f46c9 = 27:  1b0f4030 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  2698f126 = 28:  10b5946b lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  1519afe8 = 29:  bbb9eaa2 src/useradd.c: Set 'path' closer to its first use
30:  03668bb4 = 30:  79452eb9 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  a12847fb = 31:  7ee91b95 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19k
  • Rebase
$ git rd
 1:  142670d2 =  1:  184db8f2 lib/string/strspn/: Add missing const
 2:  ebe529e3 =  2:  831ebd9c autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  97d63e69 =  3:  ebfed4f4 lib/, src/: Remove unused variables
 4:  3634e877 =  4:  c464a267 src/: Unname unused parameter of main()
 5:  7be6d419 =  5:  8e1dc4ba src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  ef308a5d =  6:  8832a984 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  b37738f5 =  7:  73552a45 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  3579b9ea =  8:  5425929d lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  41791d05 =  9:  4298ffc3 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  bc0027d0 = 10:  2393523d lib/logind.c: Unname unused function parameter
11:  762b66c4 = 11:  710286de lib/: Remove unused parameter $3 of password_check() and propagate
12:  ed0ffa9f = 12:  d89dbb9d lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  50787bcf = 13:  09495dd7 lib/, src/: Remove unused parameter $3 of passwd_check()
14:  ffd23ae3 = 14:  18144380 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  57ced830 = 15:  e5152079 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  cf3e98b4 = 16:  f2ebb3e8 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  00c38aae = 17:  ccd2f395 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  c9aedf8f = 18:  75edb1e7 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  a361c824 = 19:  5ebddfb3 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  c27b6851 = 20:  09f46493 tests/unit/test_xasprintf.c: Actually return
21:  3ed32429 = 21:  58323e01 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  ee82a8c8 = 22:  6d00880e lib/: Use '(void)' to define a function with 0 parameters
23:  8e671c6a = 23:  bde68c3e lib/: addsh(): Add 'short' variant of addsl()
24:  2c6b10fb = 24:  990d83d9 lib/failure.c: Use addsh() instead of UB
25:  4aee8900 = 25:  c50a6698 lib/get_pid.c: pid_t is a signed integer
26:  56549138 = 26:  82bae7ec lib/idmapping.c: Fix format specifier for int
27:  1b0f4030 = 27:  15d82ab1 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  10b5946b = 28:  53b7e5ee lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  bbb9eaa2 = 29:  fa5eaba5 src/useradd.c: Set 'path' closer to its first use
30:  79452eb9 = 30:  2ad881b1 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  7ee91b95 = 31:  38d3c795 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v19l
  • Rebase
$ git rd 
 1:  184db8f2 =  1:  98cab975 lib/string/strspn/: Add missing const
 2:  831ebd9c =  2:  4877f7c4 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  ebfed4f4 =  3:  a6234276 lib/, src/: Remove unused variables
 4:  c464a267 =  4:  4ec601c3 src/: Unname unused parameter of main()
 5:  8e1dc4ba =  5:  9ce056d2 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  8832a984 !  6:  d2208f60 lib/, src/ tests/: Unname unused parameters in callbacks
    @@ tests/unit/test_snprintf.c: main(void)
     -test_SNPRINTF_trunc(void **state)
     +test_SNPRINTF_trunc(void **)
      {
    -   char  buf[NITEMS("foo")];
    +   char  buf[countof("foo")];
      
     @@ tests/unit/test_snprintf.c: test_SNPRINTF_trunc(void **state)
      
    @@ tests/unit/test_snprintf.c: test_SNPRINTF_trunc(void **state)
     -test_SNPRINTF_ok(void **state)
     +test_SNPRINTF_ok(void **)
      {
    -   char  buf[NITEMS("foo")];
    +   char  buf[countof("foo")];
      
     
      ## tests/unit/test_strncpy.c ##
    @@ tests/unit/test_strtcpy.c: main(void)
     -test_STRTCPY_trunc(void **state)
     +test_STRTCPY_trunc(void **)
      {
    -   char  buf[NITEMS("foo")];
    +   char  buf[countof("foo")];
      
     @@ tests/unit/test_strtcpy.c: test_STRTCPY_trunc(void **state)
      
    @@ tests/unit/test_strtcpy.c: test_STRTCPY_trunc(void **state)
     -test_STRTCPY_ok(void **state)
     +test_STRTCPY_ok(void **)
      {
    -   char  buf[NITEMS("foo")];
    +   char  buf[countof("foo")];
      
     
      ## tests/unit/test_typetraits.c ##
 7:  73552a45 =  7:  e4aa29a8 lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  5425929d =  8:  0d281f05 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  4298ffc3 =  9:  cd4b62ba lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  2393523d = 10:  431f14c5 lib/logind.c: Unname unused function parameter
11:  710286de = 11:  4bea8e34 lib/: Remove unused parameter $3 of password_check() and propagate
12:  d89dbb9d = 12:  40dbf26c lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  09495dd7 = 13:  b3ef96be lib/, src/: Remove unused parameter $3 of passwd_check()
14:  18144380 = 14:  96e8006d lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  e5152079 ! 15:  c8922db4 autogen.sh: CFLAGS: Add many errors (-Werror=...)
    @@ autogen.sh: autoreconf -v -f --install "$(dirname "$0")" || exit 1
      CFLAGS="$CFLAGS -Werror=sign-compare"
     +CFLAGS="$CFLAGS -Werror=scalar-storage-order"
     +CFLAGS="$CFLAGS -Werror=sizeof-array-div"
    -+CFLAGS="$CFLAGS -Werror=sizeof-pointer-div"
    + CFLAGS="$CFLAGS -Werror=sizeof-pointer-div"
     +CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"
     +CFLAGS="$CFLAGS -Werror=sizeof-array-argument"
     +CFLAGS="$CFLAGS -Werror=memset-elt-size"
16:  f2ebb3e8 = 16:  f60bc556 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  ccd2f395 = 17:  e30bf988 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  75edb1e7 = 18:  21096502 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  5ebddfb3 = 19:  a47c4cf4 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  09f46493 = 20:  4cd3296f tests/unit/test_xasprintf.c: Actually return
21:  58323e01 = 21:  ff6938bc src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  6d00880e = 22:  37465870 lib/: Use '(void)' to define a function with 0 parameters
23:  bde68c3e = 23:  06133776 lib/: addsh(): Add 'short' variant of addsl()
24:  990d83d9 = 24:  f275c6f0 lib/failure.c: Use addsh() instead of UB
25:  c50a6698 = 25:  876128bc lib/get_pid.c: pid_t is a signed integer
26:  82bae7ec = 26:  a809645e lib/idmapping.c: Fix format specifier for int
27:  15d82ab1 = 27:  e853f997 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  53b7e5ee = 28:  4a3e0b77 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  fa5eaba5 = 29:  6c6e5a03 src/useradd.c: Set 'path' closer to its first use
30:  2ad881b1 = 30:  20afcdb1 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  38d3c795 = 31:  2e2a283e lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v20
  • Rebase
$ git rd 
 1:  98cab975 =  1:  628840fe lib/string/strspn/: Add missing const
 2:  4877f7c4 =  2:  395c6173 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  a6234276 =  3:  0ef566c0 lib/, src/: Remove unused variables
 4:  4ec601c3 =  4:  04d49b9c src/: Unname unused parameter of main()
 5:  9ce056d2 =  5:  0c312b98 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  d2208f60 !  6:  2a4188ae lib/, src/ tests/: Unname unused parameters in callbacks
    @@ tests/unit/test_typetraits.c: test_type_max(void **state)
        assert_true(type_min(long) == LONG_MIN);
        assert_true(type_min(unsigned long) == 0);
     
    - ## tests/unit/test_xasprintf.c ##
    -@@ tests/unit/test_xasprintf.c: static jmp_buf  jmpb;
    + ## tests/unit/test_xaprintf.c ##
    +@@ tests/unit/test_xaprintf.c: static jmp_buf  jmpb;
      
      int __real_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
      int __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
     -void __wrap_exit(int status);
     +void __wrap_exit(int);
      
    - [[gnu::noipa]]
    - static int xasprintf_volatile(char *volatile *restrict s,
    -     const char *restrict fmt, ...);
    - 
    --static void test_xasprintf_exit(void **state);
    --static void test_xasprintf_ok(void **state);
    -+static void test_xasprintf_exit(void **);
    -+static void test_xasprintf_ok(void **);
    +-static void test_xaprintf_exit(void **state);
    +-static void test_xaprintf_ok(void **state);
    ++static void test_xaprintf_exit(void **);
    ++static void test_xaprintf_ok(void **);
      
      
      int
    -@@ tests/unit/test_xasprintf.c: __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap)
    +@@ tests/unit/test_xaprintf.c: __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap)
      
      
      void
    @@ tests/unit/test_xasprintf.c: __wrap_vasprintf(char **restrict p, const char *res
      {
        longjmp(jmpb, EXIT_CALLED);
      }
    -@@ tests/unit/test_xasprintf.c: xasprintf_volatile(char *volatile *restrict s, const char *restrict fmt, ...)
      
      
      static void
    --test_xasprintf_exit(void **state)
    -+test_xasprintf_exit(void **)
    +-test_xaprintf_exit(void **state)
    ++test_xaprintf_exit(void **)
      {
    -   volatile int    len;
        char *volatile  p;
    -@@ tests/unit/test_xasprintf.c: test_xasprintf_exit(void **state)
    + 
    +@@ tests/unit/test_xaprintf.c: test_xaprintf_exit(void **state)
      
      
      static void
    --test_xasprintf_ok(void **state)
    -+test_xasprintf_ok(void **)
    +-test_xaprintf_ok(void **state)
    ++test_xaprintf_ok(void **)
      {
    -   int   len;
        char  *p;
    + 
 7:  e4aa29a8 !  7:  e3fcca5d lib/, src/: Remove unused parameter $2 of audit_logger()
    @@ src/userdel.c: int main (int argc, char **argv)
     
      ## src/usermod.c ##
     @@ src/usermod.c: static char *new_pw_passwd (char *pw_pass)
    -           char  *buf;
    - 
    + {
    +   if (Lflg && ('!' != pw_pass[0])) {
      #ifdef WITH_AUDIT
     -          audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
     +          audit_logger (AUDIT_USER_CHAUTHTOK,
 8:  0d281f05 =  8:  6a9eb9dd lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  cd4b62ba =  9:  08c1f446 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  431f14c5 = 10:  fd3d2dd4 lib/logind.c: Unname unused function parameter
11:  4bea8e34 = 11:  90d664cd lib/: Remove unused parameter $3 of password_check() and propagate
12:  40dbf26c ! 12:  29be6251 lib/obscure.c: Remove unused parameter $1 of palindrome()
    @@ lib/obscure.c
      
     @@ lib/obscure.c: static /*@observer@*//*@null@*/const char *password_check (
        oldmono = strtolower(xstrdup(old));
    -   xasprintf(&wrapped, "%s%s", oldmono, oldmono);
    +   wrapped = xaprintf("%s%s", oldmono, oldmono);
      
     -  if (palindrome (oldmono, newmono)) {
     +  if (palindrome(newmono)) {
13:  b3ef96be = 13:  9157034f lib/, src/: Remove unused parameter $3 of passwd_check()
14:  96e8006d = 14:  da7daf56 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  c8922db4 = 15:  a6313d99 autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  f60bc556 = 16:  2b408d80 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  e30bf988 = 17:  5b32bc5c lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  21096502 = 18:  90e50719 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  a47c4cf4 ! 19:  03ff9bbc tests/unit/test_strncpy.c: Remove STRNCPY() tests
    @@ tests/unit/Makefile.am: check_PROGRAMS = \
     -    test_strncpy \
          test_strtcpy \
          test_typetraits \
    -     test_xasprintf
    +     test_xaprintf
     @@ tests/unit/Makefile.am: test_snprintf_LDADD = \
          $(CMOCKA_LIBS) \
          $(NULL)
20:  4cd3296f <  -:  -------- tests/unit/test_xasprintf.c: Actually return
21:  ff6938bc = 20:  f30a5f4b src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
22:  37465870 = 21:  8b28f3a3 lib/: Use '(void)' to define a function with 0 parameters
23:  06133776 = 22:  279840b1 lib/: addsh(): Add 'short' variant of addsl()
24:  f275c6f0 = 23:  16a5152b lib/failure.c: Use addsh() instead of UB
25:  876128bc = 24:  4fc4bd1b lib/get_pid.c: pid_t is a signed integer
26:  a809645e = 25:  fdacf90f lib/idmapping.c: Fix format specifier for int
27:  e853f997 = 26:  0b1b5d3b lib/, src/: Use (intmax_t) to print a gid_t/uid_t
28:  4a3e0b77 = 27:  64a8127b lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
29:  6c6e5a03 = 28:  0597eddc src/useradd.c: Set 'path' closer to its first use
30:  20afcdb1 = 29:  0bd8d054 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
31:  2e2a283e = 30:  3363fc0b lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v21
  • Rebase
$ git rd 
 1:  628840fe =  1:  ee95ede9 lib/string/strspn/: Add missing const
 2:  395c6173 =  2:  57cb9273 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  0ef566c0 !  3:  b7a3e7fe lib/, src/: Remove unused variables
    @@ Metadata
     Author: Alejandro Colomar <[email protected]>
     
      ## Commit message ##
    -    lib/, src/: Remove unused variables
    +    src/useradd.c: Remove unused variable
     
    -    Fixes: 99a3ca17dfa0 (2024-11-10; "lib/list.c: comma_to_list(): Use strchrcnt() instead of its pattern")
         Fixes: d91b22cc2f6d (2024-07-08; "lib/, src/: Use stpsep() instead of its pattern")
         Signed-off-by: Alejandro Colomar <[email protected]>
     
    - ## lib/list.c ##
    -@@ lib/list.c: comma_to_list(const char *comma)
    -   char **array;
    -   int i;
    -   char *cp;
    --  char *cp2;
    - 
    -   assert (NULL != comma);
    - 
    -
      ## src/useradd.c ##
     @@ src/useradd.c: set_defaults(void)
        char  *new_file = NULL;
 4:  04d49b9c =  4:  9307f8ba src/: Unname unused parameter of main()
 5:  0c312b98 =  5:  afe84f22 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  2a4188ae =  6:  9d268264 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  e3fcca5d =  7:  db28aafc lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  6a9eb9dd =  8:  20c759c7 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  08c1f446 =  9:  c305cb59 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  fd3d2dd4 = 10:  8abbe1e7 lib/logind.c: Unname unused function parameter
11:  90d664cd = 11:  72332e17 lib/: Remove unused parameter $3 of password_check() and propagate
12:  29be6251 = 12:  10b25399 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  9157034f = 13:  c33585aa lib/, src/: Remove unused parameter $3 of passwd_check()
14:  da7daf56 = 14:  5f3f9926 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  a6313d99 = 15:  d773c88d autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  2b408d80 = 16:  65e582e4 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  5b32bc5c = 17:  c68a481d lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  90e50719 = 18:  6e571587 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  03ff9bbc = 19:  7b4cdcf7 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  f30a5f4b = 20:  494e519e src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
21:  8b28f3a3 = 21:  7e68f9d5 lib/: Use '(void)' to define a function with 0 parameters
22:  279840b1 = 22:  dc547de8 lib/: addsh(): Add 'short' variant of addsl()
23:  16a5152b = 23:  98e7e841 lib/failure.c: Use addsh() instead of UB
24:  4fc4bd1b <  -:  -------- lib/get_pid.c: pid_t is a signed integer
25:  fdacf90f = 24:  092a262e lib/idmapping.c: Fix format specifier for int
26:  0b1b5d3b = 25:  e7e88c6c lib/, src/: Use (intmax_t) to print a gid_t/uid_t
27:  64a8127b = 26:  793142c4 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
28:  0597eddc = 27:  6f47a604 src/useradd.c: Set 'path' closer to its first use
29:  0bd8d054 = 28:  0c8e9145 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
30:  3363fc0b = 29:  0665e166 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v22
  • Use countof instead of NITEMS().
$ git range-diff shadow/master gh/c c 
 1:  ee95ede9 =  1:  ee95ede9 lib/string/strspn/: Add missing const
 2:  57cb9273 =  2:  57cb9273 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  b7a3e7fe =  3:  b7a3e7fe src/useradd.c: Remove unused variable
 4:  9307f8ba =  4:  9307f8ba src/: Unname unused parameter of main()
 5:  afe84f22 =  5:  afe84f22 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  9d268264 =  6:  9d268264 lib/, src/ tests/: Unname unused parameters in callbacks
 7:  db28aafc =  7:  db28aafc lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  20c759c7 =  8:  20c759c7 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  c305cb59 =  9:  c305cb59 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  8abbe1e7 = 10:  8abbe1e7 lib/logind.c: Unname unused function parameter
11:  72332e17 = 11:  72332e17 lib/: Remove unused parameter $3 of password_check() and propagate
12:  10b25399 = 12:  10b25399 lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c33585aa = 13:  c33585aa lib/, src/: Remove unused parameter $3 of passwd_check()
14:  5f3f9926 = 14:  5f3f9926 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  d773c88d = 15:  d773c88d autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  65e582e4 = 16:  65e582e4 lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  c68a481d = 17:  c68a481d lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  6e571587 = 18:  6e571587 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7b4cdcf7 = 19:  7b4cdcf7 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  494e519e = 20:  494e519e src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
21:  7e68f9d5 = 21:  7e68f9d5 lib/: Use '(void)' to define a function with 0 parameters
22:  dc547de8 ! 22:  54fe7d87 lib/: addsh(): Add 'short' variant of addsl()
    @@ lib/adds.h
     +({                                                                            \
     +  short  addend_[] = {a, b, __VA_ARGS__};                               \
     +                                                                              \
    -+  addshN(NITEMS(addend_), addend_);                                     \
    ++  addshN(countof(addend_), addend_);                                    \
     +})
     +
     +
23:  98e7e841 = 23:  173cbcc4 lib/failure.c: Use addsh() instead of UB
24:  092a262e = 24:  ba4cee0c lib/idmapping.c: Fix format specifier for int
25:  e7e88c6c = 25:  3ba35746 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
26:  793142c4 = 26:  7651f690 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
27:  6f47a604 = 27:  62bd4e1f src/useradd.c: Set 'path' closer to its first use
28:  0c8e9145 = 28:  72be743b src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
29:  0665e166 = 29:  5284e8b4 lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v23
$ git range-diff master..gh/c gh/dd..c
 1:  ee95ede9 =  1:  d9ac1622 lib/string/strspn/: Add missing const
 2:  57cb9273 =  2:  bcc4b910 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  b7a3e7fe <  -:  -------- src/useradd.c: Remove unused variable
 4:  9307f8ba =  3:  05cdcd05 src/: Unname unused parameter of main()
 5:  afe84f22 <  -:  -------- src/gpasswd.c: Remove unused parameter $1 of check_perms()
 6:  9d268264 =  4:  d7fd496a lib/, src/ tests/: Unname unused parameters in callbacks
 7:  db28aafc <  -:  -------- lib/, src/: Remove unused parameter $2 of audit_logger()
 8:  20c759c7 <  -:  -------- lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 9:  c305cb59 <  -:  -------- lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
10:  8abbe1e7 =  5:  36ec3a4d lib/logind.c: Unname unused function parameter
11:  72332e17 <  -:  -------- lib/: Remove unused parameter $3 of password_check() and propagate
12:  10b25399 <  -:  -------- lib/obscure.c: Remove unused parameter $1 of palindrome()
13:  c33585aa <  -:  -------- lib/, src/: Remove unused parameter $3 of passwd_check()
14:  5f3f9926 =  6:  520fc3e7 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
15:  d773c88d =  7:  81b1fbea autogen.sh: CFLAGS: Add many errors (-Werror=...)
16:  65e582e4 =  8:  428596df lib/sssd.h: sssd_flush_cache(): Define as static inline function
17:  c68a481d =  9:  64eeb669 lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
18:  6e571587 = 10:  00218fe0 tests/unit/test_snprintf.c: Ignore diagnostic in test
19:  7b4cdcf7 = 11:  5e54dbe0 tests/unit/test_strncpy.c: Remove STRNCPY() tests
20:  494e519e = 12:  8f050f08 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
21:  7e68f9d5 = 13:  02ef0ba5 lib/: Use '(void)' to define a function with 0 parameters
22:  54fe7d87 = 14:  2a72f602 lib/: addsh(): Add 'short' variant of addsl()
23:  173cbcc4 = 15:  8d21c2fd lib/failure.c: Use addsh() instead of UB
24:  ba4cee0c = 16:  8ff22aa7 lib/idmapping.c: Fix format specifier for int
25:  3ba35746 = 17:  d59e1fe5 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
26:  7651f690 = 18:  fbdabc7b lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
27:  62bd4e1f = 19:  807814b7 src/useradd.c: Set 'path' closer to its first use
28:  72be743b = 20:  a5c5963b src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
29:  5284e8b4 = 21:  9afeaf7b lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic
v23b
  • Rebase
$ git range-diff gh/dd..gh/c dd..c
 1:  d9ac1622 =  1:  02f3399d lib/string/strspn/: Add missing const
 2:  bcc4b910 =  2:  5d4f98d9 autogen.sh: CFLAGS: Promote -Wdiscarded-qualifiers to an error
 3:  05cdcd05 =  3:  1121c324 src/: Unname unused parameter of main()
 4:  d7fd496a =  4:  e73fa10a lib/, src/ tests/: Unname unused parameters in callbacks
 5:  36ec3a4d =  5:  a9bbd0cb lib/logind.c: Unname unused function parameter
 6:  520fc3e7 =  6:  761f9553 lib/, src/: Add [[gnu::unused]] to parameters used in conditionally-compiled code
 7:  81b1fbea =  7:  577c156a autogen.sh: CFLAGS: Add many errors (-Werror=...)
 8:  428596df =  8:  03d2bbc6 lib/sssd.h: sssd_flush_cache(): Define as static inline function
 9:  64eeb669 =  9:  01f039da lib/prefix_flag.c: Add [[gnu::unused]] to variable used in conditionally-compiled code
10:  00218fe0 = 10:  e12d6f6a tests/unit/test_snprintf.c: Ignore diagnostic in test
11:  5e54dbe0 = 11:  fd85fecc tests/unit/test_strncpy.c: Remove STRNCPY() tests
12:  8f050f08 = 12:  96945d92 src/login.c: main(): Wrap uses of 'subroot' in ifndef USE_PAM
13:  02ef0ba5 = 13:  9f32dbef lib/: Use '(void)' to define a function with 0 parameters
14:  2a72f602 = 14:  200807b0 lib/: addsh(): Add 'short' variant of addsl()
15:  8d21c2fd = 15:  124b173e lib/failure.c: Use addsh() instead of UB
16:  8ff22aa7 = 16:  e1b51227 lib/idmapping.c: Fix format specifier for int
17:  d59e1fe5 = 17:  aea19195 lib/, src/: Use (intmax_t) to print a gid_t/uid_t
18:  fbdabc7b = 18:  28ff5d23 lib/subordinateio.c: Parse a uid_t with get_uid() instead of sscanf(3)
19:  807814b7 = 19:  36261365 src/useradd.c: Set 'path' closer to its first use
20:  a5c5963b = 20:  4a34a606 src/useradd.c: create_home(): Use dynamic memory instead of an unbounded VLA
21:  9afeaf7b = 21:  c2ca033c lib/sub.c: subsystem(): Prevent -Wstrict-overflow diagnostic

@zeha
Copy link
Contributor

zeha commented Feb 19, 2025

same thing apparently in lib/string/strspn/strrcspn.h. sorry, didn't see that at first

@alejandro-colomar
Copy link
Collaborator Author

same thing apparently in lib/string/strspn/strrcspn.h. sorry, didn't see that at first

Thanks! Fixed.

@alejandro-colomar alejandro-colomar changed the title lib/string/strspn/strrspn.h: Add missing const lib/string/strspn/: Add missing const Feb 20, 2025
@alejandro-colomar alejandro-colomar changed the title lib/string/strspn/: Add missing const -Werror=all Feb 21, 2025
@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Feb 21, 2025

@zeha , @hallyn , @ikerexxe , @thesamesam , @jubalh

I've enabled -Werror=all. This will prevent trivial accidents (e.g., missing const) from entering the code base again. Since -Wall has a very low rate of false positives, it shouldn't be problematic to distributors (unlike -Wextra maybe, although I would be tempted to enable it and let distros append -Wno-error=extra if they want).

@alejandro-colomar
Copy link
Collaborator Author

This PR is queued after #1205 (that one has some patches that are needed to compile cleanly with -Werror=all).

@zeha
Copy link
Contributor

zeha commented Feb 21, 2025

With gcc-15 I see one warning left on this branch:

lastlog.c: In function ‘print_one’:
lastlog.c:119:34: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘__off_t’ {aka ‘long int’} [-Wsign-compare]
  119 |         if (offset + sizeof (ll) <= statbuf.st_size) {
      |                                  ^~

I guess this might be in #1205 but I haven't checked.

@alejandro-colomar
Copy link
Collaborator Author

With gcc-15 I see one warning left on this branch:

lastlog.c: In function ‘print_one’:
lastlog.c:119:34: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘__off_t’ {aka ‘long int’} [-Wsign-compare]
  119 |         if (offset + sizeof (ll) <= statbuf.st_size) {
      |                                  ^~

I guess this might be in #1205 but I haven't checked.

Yes, it is. Maybe I should just cherry-pick it here and open this PR for review too.

@alejandro-colomar
Copy link
Collaborator Author

I've cherry-picked the changes from #1205. Let's see if this compiles cleanly everywhere. :)

@alejandro-colomar

This comment was marked as outdated.

@thesamesam
Copy link
Contributor

As packagers, we don't generally want to see forced -Werror, but because you're only doing it in autogen.sh (which we don't use, and the existence of autogen.sh is an antipattern), it doesn't affect us in Gentoo at least.

The conventional way of doing this is a --enable-werror configure flag.

@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Feb 21, 2025 via email

@thesamesam
Copy link
Contributor

It's actually not forced. If you append to CFLAGS, you'll override prior options, so it's a default, not a forced value, IMO.

OK, whatever. It's still considered bad if I have to override it with -Wno-error.

Out of ignorance: Why? It's been there since forever, and as you know, I don't know autotools enough to question it. :)

It generally means that configure.ac (or Makefile.am) is missing some directives to make it pick up macros from the right locations. i.e. if autoreconf doesn't work in a project, that's a bug and should be fixed properly in configure.ac or Makefile.am, rather than by adding a script.

Sometimes the scripts also do gnarly things like download from the internet as well, so we avoid them.

On the other hand, -Werror=all is quite conservative compared to -Werror. I guess it would be more or less okay to have -Werror=all even in a file that was used by Gentoo.

The issue is the non-determinism based on compiler if -Wall contents change. That said, we are okay with specific -Werror=x (even if occasionally, those sometimes cause problems) where x is a specific warning. I don't think I've ever come across someone proposing -Werror=all in a packaging context before though. I agree that it is better than -Werror for distributors. I'm not sure if it's fine for us though.

Where did that convention grow out of? Did people find it too inconvenient to do this?

Ah, so there's two issues here:

  1. we usually prefer that if such a flag exists, it's default-off, but sometimes projects make it default-on based on e.g. presence of .git (or other heuristics to detect a "developer environment"), and
  2. your example make invocation clobbers whatever CFLAGS is rather than appending to it, which is often problematic, so you can't really do it without inspecting a project's Makefiles first

@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Feb 21, 2025 via email

@NHOrus
Copy link

NHOrus commented Feb 21, 2025

Please don't add -Werror in default configuration. Future maintainers would say thank you for that. Because you don't know what kind of bright idea new, wonderful C compiler brings in the future and how compatible it would be with your code, and someone must be making it running on future hardware when you are dead.

Better add some kind of sanitized option to make that builds with both -Werror=all -Werror=extra and all the sanitizers that are sane to enable, for running CI with it.
-fsanitize=address,undefined are perfect for finding tricky errors when placed in CI runs.

Note that sanitizers tend to increase the rate of false positive warnings, most notably those around -Wmaybe-uninitialized. We recommend against combining -Werror and [the use of] sanitizers.

Fixes: d91b22c (2024-07-08; "lib/, src/: Use stpsep() instead of its pattern")
Signed-off-by: Alejandro Colomar <[email protected]>
Fixes: 53e1eb4 (2024-07-01; "src/: Remove dead code")
Signed-off-by: Alejandro Colomar <[email protected]>
Propagate the removal of dead code to its callers, which were only
passing the parameter to this function.

Signed-off-by: Alejandro Colomar <[email protected]>
Closes: <shadow-maint#1218>
Reported-by: Chris Hofstaedtler <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
I had to omit some really nice ones due to autotools failing badly on
them.  :/

Signed-off-by: Alejandro Colomar <[email protected]>
Being a macro, the unused return value triggers a diagnostic.
This probably needs further investigation, but we have the issue linked
below for that.

Link: <shadow-maint#1221>
Signed-off-by: Alejandro Colomar <[email protected]>
This would be wrong most of the time, but here we're testing corner
cases, so let's ignore the diagnostic here.

Signed-off-by: Alejandro Colomar <[email protected]>
It's just the obvious thin wrapper around strncpy(3); let's trust it's
ok.

The reason for removing this test is that GCC has bogus diagnostics
for strncpy(3).  Its diagnostics are geared towards helping people
that abuse strncpy(3) as a poor-man's strlcpy(3) not write exploitable
code as easily.  Using strncpy(3) for that purpose is brain damaged, and
those programs should be audited to stop using this API for that.  And
most importantly, GCC should stop encouraging writing bad code that
calls strncpy(3) as that results in diagnostics that are actively
harmful for us, legitimate users of strncpy(3).  Those false positives
should certainly be out of -Wall.

We could fill the tests with pragmas, but let's just remove the tests.
I don't feel like maintaining code for ignoring GCC's brain bamage.

If people want to write a function for truncating strings (because they
can't rely on strlcpy(3) being available, or because they don't like
it), they certainly should write such an API.  strncpy(3) isn't that
API.  strncpy(3) is a function that takes a string and writes it into a
utmpx(5) member, which is NOT a string.  (And I heard it might also be
useful for implementing tar(1), which also uses non-terminated character
arrays, but I never looked at that code.)

Link: <>
Signed-off-by: Alejandro Colomar <[email protected]>
This variable is only read if !USE_PAM.  Writing to it unconditionally
triggers -Werror=unused-but-set-variable errors.  Let's wrap it in
ifndef to avoid the error.

Signed-off-by: Alejandro Colomar <[email protected]>
This avoids a diagnostic from -Wold-style-definition.

Signed-off-by: Alejandro Colomar <[email protected]>
We were actually triggering undefined behavior to prevent overflow.
Do the same thing, but correctly.

Signed-off-by: Alejandro Colomar <[email protected]>
…ded VLA

Fixes: b3b6d9d (2018-05-15; "Create parent dirs for useradd -m")
Cc: Michael Vetter <[email protected]>
Cc: Thorsten Kukuk <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
The compiler thinks ++depth within the conditional could overflow the
type, because it doesn't see that exit(3) will terminate the program.
Let's make it easy for the compiler, and only increment the value if
we're not going to call exit(3).

Signed-off-by: Alejandro Colomar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

string/strspn/strrcspn.h: assignment discards 'const' qualifier from pointer target type
4 participants