OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_13_2-66-gef3da57b

Gerrit Code Review gerrit@openafs.org
Thu, 3 Jul 2025 11:46:15 -0400


The following commit has been merged in the openafs-stable-1_8_x branch:
commit ef3da57b8c3bfdf4bf3dc0dcd9458ace0ddc2709
Author: Cheyenne Wills <cwills@sinenomine.net>
Date:   Fri Apr 25 11:43:01 2025 -0600

    ubik: Use typedef for ubik_call function parameter
    
    One of ubik_Call()/ubik_CallIter()/ubik_Call_SingleServer() parameters
    is a function pointer (aproc). A function signature for this parameter
    is not specified which leads to a strict-prototype warning which has
    been addressed by suppressing the check by adding the
    -Wno-strict-prototypes compiler flag for the files that need it.
    
    A new C standard (C23) is coming out and newer versions of C compilers
    (e.g. gcc 15) are using the new standard (or an extension of that
    standard) as their default. The C23 standard has removed the ability to
    declare functions with unspecified parameters; now any function that is
    declared as:
    
       int foo();
    
    is treated as:
    
       int foo(void);
    
    Building with gcc-15 results in the following types of compile time
    errors (even when -Wno-strict-prototypes is used):
    
      ubikclient.c: In function ‘CallIter’:
      ubikclient.c:391:10: error: too many arguments to function ‘aproc’; expected 0, have 17
        391 |         (*aproc) (tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13,
            |         ~^~~~~~~  ~~
      ubikclient.c: In function ‘ubik_Call’:
      ubikclient.c:577:18: error: too many arguments to function ‘aproc’; expected 0, have 17
        577 |                 (*aproc) (tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
            |                 ~^~~~~~~  ~~
    
    To avoid this error, we must declare the parameters for the 'aproc'
    function pointer.
    
    Define a typedef, ubik_call_func, that can be used to define the data
    type for the function parameter and can also be used as a cast on the
    function parameter when calling ubik_Call() ubik_CallIter() or
    ubik_Call_SingleServer().
    
    Update the function prototypes and definitions for ubik_Call()
    ubik_CallIter() and ubik_Call_SingleServer(), and add casts where
    needed.
    
    Define "UBIK_LEGACY_CALLITER" in ubik_db_if.c, so it can also use the
    ubik_call_func typedef for its ubik_Call_SingleServer variant.
    
    Remove the -Wno-strict-prototypes for the files that were updated. The
    CFLAGS_NOSTRICT_PROTOTYPES autoconf var is now unused, so remove it.
    
    Some minor whitespace/indentation cleanup.
    
    Note: This problem occurred on Fedora 42 which comes with gcc 15.
    
    Reviewed-on: https://gerrit.openafs.org/16370
    Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
    Tested-by: Cheyenne Wills <cwills@sinenomine.net>
    Reviewed-by: Andrew Deason <adeason@sinenomine.net>
    (cherry picked from commit eddd5a060e9ed5acf10ee23359d54e22d4681592)
    
     Conflicts:
    	doc/process/compiler-warnings.md  - updated CODING instead
    	src/cf/osconf.m4 - Due to differences with master
    
    Change-Id: I75c40c3cc443a3b7c9039a248abed1a864746aae
    Reviewed-on: https://gerrit.openafs.org/16380
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

 CODING                          |  5 -----
 src/bucoord/Makefile.in         |  1 -
 src/bucoord/ubik_db_if.c        |  7 ++++---
 src/cf/osconf.m4                |  3 ---
 src/kauth/Makefile.in           |  3 ---
 src/kauth/admin_tools.c         |  4 ++--
 src/kauth/authclient.c          |  8 ++++----
 src/libadmin/kas/Makefile.in    |  1 -
 src/libadmin/kas/afs_kasAdmin.c |  4 ++--
 src/tbutc/Makefile.in           |  1 -
 src/ubik/Makefile.in            |  2 --
 src/ubik/ubik.p.h               | 13 ++++++++++---
 src/ubik/ubikclient.c           |  8 ++++----
 13 files changed, 26 insertions(+), 34 deletions(-)

-- 
OpenAFS Master Repository