Project

General

Profile

Actions

Bug #14385

closed

libnsl: mismatched bound

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with gcc 11:

    ../nis/gen/nis_misc_proc.c:203:54: error: argument 2 of type 'char[256]' with mismatched bound [-Werror=array-parameter=]
      203 | __nis_gssprin2netname(rpc_gss_principal_t prin, char netname[MAXNETNAMELEN+1])
          |                                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../nis/gen/nis_misc_proc.c:40:
    /code/illumos-gate/usr/src/lib/libnsl/include/rpcsvc/nis_dhext.h:154:48: note: previously declared as 'char[]'
      154 | int __nis_gssprin2netname(rpc_gss_principal_t, char []);
          |                                                ^~~~~~~
    cc1: all warnings being treated as errors

    ../yp/dbm.c:394:15: error: argument 1 of type 'char[1024]' with mismatched bound [-Werror=array-parameter=]
      394 | makdatum(char buf[PBLKSIZ], int n)
          |          ~~~~~^~~~~~~~~~~~
    In file included from ../yp/dbm.c:40:
    /code/illumos-gate/proto/root_i386/usr/include/rpcsvc/dbm.h:70:18: note: previously declared as 'char *'
       70 | datum   makdatum(char *, int);
          |                  ^~~~~~
    ../yp/dbm.c:506:14: error: argument 1 of type 'char[1024]' with mismatched bound [-Werror=array-parameter=]
      506 | delitem(char buf[PBLKSIZ], int n)
          |         ~~~~~^~~~~~~~~~~~
    ../yp/dbm.c:51:14: note: previously declared as 'char *'
       51 | void delitem(char *, int);
          |              ^~~~~~
    ../yp/dbm.c:540:14: error: argument 1 of type 'char[1024]' with mismatched bound [-Werror=array-parameter=]
      540 | additem(char buf[PBLKSIZ], datum item)
          |         ~~~~~^~~~~~~~~~~~
    ../yp/dbm.c:53:14: note: previously declared as 'char *'
       53 | int  additem(char *, datum);
          |              ^~~~~~
    ../yp/dbm.c:564:13: error: argument 1 of type 'char[1024]' with mismatched bound [-Werror=array-parameter=]
      564 | chkblk(char buf[PBLKSIZ])
          |        ~~~~~^~~~~~~~~~~~
    ../yp/dbm.c:52:13: note: previously declared as 'char *'
       52 | void chkblk(char *);
          |             ^~~~~~
    cc1: all warnings being treated as errors

    ../rpc/netnamer.c:375:25: error: argument 1 of type 'const char[256]' with mismatched bound [-Werror=array-parameter=]
      375 | netname2user(const char netname[MAXNETNAMELEN + 1], uid_t *uidp, gid_t *gidp,
          |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/rpc/rpc.h:59,
                     from ../rpc/rpc_mt.h:37,
                     from ../rpc/netnamer.c:53:
    /code/illumos-gate/proto/root_i386/usr/include/rpc/auth.h:389:25: note: previously declared as 'const char *'
      389 | extern int netname2user(const char *, uid_t *, gid_t *, int *, gid_t *);
          |                         ^~~~~~~~~~~~
    ../rpc/netnamer.c:467:25: error: argument 1 of type 'const char[256]' with mismatched bound [-Werror=array-parameter=]
      467 | netname2host(const char netname[MAXNETNAMELEN + 1], char *hostname,
          |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/rpc/rpc.h:59,
                     from ../rpc/rpc_mt.h:37,
                     from ../rpc/netnamer.c:53:
    /code/illumos-gate/proto/root_i386/usr/include/rpc/auth.h:391:25: note: previously declared as 'const char *'
      391 | extern int netname2host(const char *, char *, const int);
          |                         ^~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../rpc/netname.c:142:17: error: argument 1 of type 'char[256]' with mismatched bound [-Werror=array-parameter=]
      142 | getnetname(char name[MAXNETNAMELEN + 1])
          |            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/rpc/rpc.h:59,
                     from ../rpc/rpc_mt.h:37,
                     from ../rpc/netname.c:52:
    /code/illumos-gate/proto/root_i386/usr/include/rpc/auth.h:385:23: note: previously declared as 'char *'
      385 | extern int getnetname(char *);
          |                       ^~~~~~
    ../rpc/netname.c:177:19: error: argument 1 of type 'char[256]' with mismatched bound [-Werror=array-parameter=]
      177 | user2netname(char netname[MAXNETNAMELEN + 1], const uid_t uid,
          |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/rpc/rpc.h:59,
                     from ../rpc/rpc_mt.h:37,
                     from ../rpc/netname.c:52:
    /code/illumos-gate/proto/root_i386/usr/include/rpc/auth.h:387:25: note: previously declared as 'char *'
      387 | extern int user2netname(char *, const uid_t, const char *);
          |                         ^~~~~~
    ../rpc/netname.c:268:19: error: argument 1 of type 'char[256]' with mismatched bound [-Werror=array-parameter=]
      268 | host2netname(char netname[MAXNETNAMELEN + 1], const char *host,
          |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/rpc/rpc.h:59,
                     from ../rpc/rpc_mt.h:37,
                     from ../rpc/netname.c:52:
    /code/illumos-gate/proto/root_i386/usr/include/rpc/auth.h:386:25: note: previously declared as 'char *'
      386 | extern int host2netname(char *, const char *, const char *);
          |                         ^~~~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot, wsdiff is only showing debug info differences.

Actions #1

Updated by Electric Monk over 1 year ago

  • Gerrit CR set to 1932
Actions #2

Updated by Toomas Soome over 1 year ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 89fbfe0d2fbdaef52447ae1ca77634c69a3cf220

commit  89fbfe0d2fbdaef52447ae1ca77634c69a3cf220
Author: Toomas Soome <tsoome@me.com>
Date:   2022-01-29T23:02:26.000Z

    14385 libnsl: mismatched bound
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF