Project

General

Profile

Actions

Bug #14378

closed

cmd-inet: build errors with gcc 11

Added by Toomas Soome 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Bundle of issues from cmd-inet subtree.

    /code/illumos-gate/usr/src/contrib/mDNSResponder/mDNSPosix/mDNSPosix.c:1838:38: error: argument 1 of type 'mDNSu32[]' {aka 'unsigned int[]'} with mismatched bound [-Werror=array-parameter=]
     1838 | mDNSexport void DNSProxyInit(mDNSu32 IpIfArr[], mDNSu32 OpIf)
          |                              ~~~~~~~~^~~~~~~~~
    In file included from /code/illumos-gate/usr/src/contrib/mDNSResponder/mDNSPosix/mDNSPosix.c:55:
    /code/illumos-gate/usr/src/contrib/mDNSResponder/mDNSCore/dnsproxy.h:32:34: note: previously declared as 'mDNSu32[5]' {aka 'unsigned int[5]'}
       32 | extern void DNSProxyInit(mDNSu32 IpIfArr[MaxIp], mDNSu32 OpIf);
          |                          ~~~~~~~~^~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_nfs4.c:251:56: error: expression does not compute the number of elements in this array; element type is 'op_info_t', not 'op_info_t *' [-Werror=sizeof-array-div]
      251 | static uint_t cb_num_opcodes = sizeof (cb_opcode_info) / sizeof (op_info_t *);
          |                                                        ^
    snoop_nfs4.c:251:56: note: add parentheses around the second 'sizeof' to silence this warning
    snoop_nfs4.c:240:18: note: array 'cb_opcode_info' declared here
      240 | static op_info_t cb_opcode_info[] = {
          |                  ^~~~~~~~~~~~~~
    snoop_nfs4.c:342:50: error: expression does not compute the number of elements in this array; element type is 'op_info_t', not 'op_info_t *' [-Werror=sizeof-array-div]
      342 | static uint_t num_opcodes = sizeof (opcode_info) / sizeof (op_info_t *);
          |                                                  ^
    snoop_nfs4.c:342:50: note: add parentheses around the second 'sizeof' to silence this warning
    snoop_nfs4.c:253:18: note: array 'opcode_info' declared here
      253 | static op_info_t opcode_info[] = {
          |                  ^~~~~~~~~~~
    cc1: all warnings being treated as errors

    arp.c: In function 'main':
    arp.c:81:27: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
       81 |                         } else                  \
          |                           ^~~~
    arp.c:96:17: note: in expansion of macro 'CASE'
       96 |                 CASE('a', a);
          |                 ^~~~
    arp.c:83:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
       83 |                                 nflags++;       \
          |                                 ^~~~~~
    arp.c:96:17: note: in expansion of macro 'CASE'
       96 |                 CASE('a', a);
          |                 ^~~~
    arp.c:81:27: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
       81 |                         } else                  \
          |                           ^~~~
    arp.c:97:17: note: in expansion of macro 'CASE'
       97 |                 CASE('d', d);
          |                 ^~~~
    arp.c:83:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
       83 |                                 nflags++;       \
          |                                 ^~~~~~
    arp.c:97:17: note: in expansion of macro 'CASE'
       97 |                 CASE('d', d);
          |                 ^~~~
    arp.c:81:27: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
       81 |                         } else                  \
          |                           ^~~~
    arp.c:98:17: note: in expansion of macro 'CASE'
       98 |                 CASE('f', f);
          |                 ^~~~
    arp.c:83:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
       83 |                                 nflags++;       \
          |                                 ^~~~~~
    arp.c:98:17: note: in expansion of macro 'CASE'
       98 |                 CASE('f', f);
          |                 ^~~~
    arp.c:81:27: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
       81 |                         } else                  \
          |                           ^~~~
    arp.c:99:17: note: in expansion of macro 'CASE'
       99 |                 CASE('s', s);
          |                 ^~~~
    arp.c:83:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
       83 |                                 nflags++;       \
          |                                 ^~~~~~
    arp.c:99:17: note: in expansion of macro 'CASE'
       99 |                 CASE('s', s);
          |                 ^~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot, arp, snoop and mdnsd all appear to work as expected.

Actions #1

Updated by Electric Monk 7 months ago

  • Gerrit CR set to 1923
Actions #2

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 7 months ago

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

git commit 19f828dfeb540cb7af7e68528aa8711911d3ed39

commit  19f828dfeb540cb7af7e68528aa8711911d3ed39
Author: Toomas Soome <tsoome@me.com>
Date:   2022-01-11T17:25:57.000Z

    14378 cmd-inet: build errors with gcc 11
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF