OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-91-gfd22b17

Gerrit Code Review gerrit@openafs.org
Thu, 16 Sep 2021 12:45:29 -0400


The following commit has been merged in the master branch:
commit fd22b1720887d27f1d59f7c66e00f2e78cdfe49a
Author: Andrew Deason <adeason@sinenomine.net>
Date:   Wed Feb 10 16:42:16 2021 -0600

    rxgen: Generate default switch arm for void
    
    When defining an xdr union with a 'default' arm, rxgen generates xdr
    routines like this:
    
        bool_t
        xdr_myunion(...)
        {
            switch (objp->op) {
            case FOO:
                xdr_foo(...);
                break;
    
            default:
                xdr_default(...);
                break;
            }
        }
    
    However, if the default arm of the union is just 'void;', we just
    don't generate a 'default:' arm in the switch statment in the
    generated routines. If there are enum values that are not explicitly
    specified, and are handled by the default arm, this generates a
    compiler warning (which breaks the build for --enable-checking):
    
        foo_int.xdr.c:80:2 error: enumeration value 'BAR' not handled in switch [-Werror=switch]
        switch (objp->op) {
    
    To avoid this, change rxgen to always generate a 'default' arm in the
    generated switch if there's one specified in the RPC-L. For a void
    default, just generate an empty default arm, which avoids the compiler
    warning.
    
    Change-Id: I6ac457a4669439ef896b9cad6eb7de2f03068b69
    Reviewed-on: https://gerrit.openafs.org/14798
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

 src/rxgen/rpc_cout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
OpenAFS Master Repository