Project

General

Profile

Actions

Bug #9708

closed

loader: libstand warning: pointer targets differ in signedness

Added by Toomas Soome almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Multiple signed vs unsigned issues in libstand:

    /code/illumos-gate/usr/src/boot/lib/libstand/net.c: In function 'ip_convertaddr':
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:284:16: warning: pointer targets in passing argument 2 of 'number' differ in signedness [-Wpointer-sign]
      p = number(p, &n);
                    ^
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:269:1: note: expected 'int *' but argument is of type 'n_long * {aka unsigned int *}'
     number(char *s, int *n)
     ^~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:288:16: warning: pointer targets in passing argument 2 of 'number' differ in signedness [-Wpointer-sign]
      p = number(p, &n);
                    ^
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:269:1: note: expected 'int *' but argument is of type 'n_long * {aka unsigned int *}'
     number(char *s, int *n)
     ^~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:292:16: warning: pointer targets in passing argument 2 of 'number' differ in signedness [-Wpointer-sign]
      p = number(p, &n);
                    ^
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:269:1: note: expected 'int *' but argument is of type 'n_long * {aka unsigned int *}'
     number(char *s, int *n)
     ^~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:296:16: warning: pointer targets in passing argument 2 of 'number' differ in signedness [-Wpointer-sign]
      p = number(p, &n);
                    ^
    /code/illumos-gate/usr/src/boot/lib/libstand/net.c:269:1: note: expected 'int *' but argument is of type 'n_long * {aka unsigned int *}'
     number(char *s, int *n)
     ^~~~~~

    /code/illumos-gate/usr/src/boot/lib/libstand/nfs.c: In function 'nfs_readdir':
    /code/illumos-gate/usr/src/boot/lib/libstand/nfs.c:829:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
      buf = (u_char *)&rent->nameplus[pos];

    /code/illumos-gate/usr/src/boot/lib/libstand/gzipfs.c: In function 'zf_fill':
    /code/illumos-gate/usr/src/boot/lib/libstand/gzipfs.c:81:25: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
      zf->zf_zstream.next_in = zf->zf_buf;
                             ^
    /code/illumos-gate/usr/src/boot/lib/libstand/bootp.c: In function 'bootp':
    /code/illumos-gate/usr/src/boot/lib/libstand/bootp.c:157:10: error: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Werror=pointer-sign]
      strncpy(bp->bp_file, bootfile, sizeof(bp->bp_file));
              ^~

    /code/illumos-gate/usr/src/boot/lib/libstand/bootp.c: In function 'setenv_':
    /code/illumos-gate/usr/src/boot/lib/libstand/bootp.c:741:32: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
       if (op->fmt == __ILIST && (s = strchr(vp, ';')))
                                    ^
    /code/illumos-gate/usr/src/boot/lib/libstand/bootp.c:744:6: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
       vp = s; /* prepare for next round */
          ^

    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c: In function 'dos_readdir':
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:476:20: error: pointer targets in passing argument 1 of 'dos_checksum' differ in signedness [-Werror=pointer-sign]
       x = dos_checksum(dd.de.name, dd.de.ext);
                        ^~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:406:1: note: expected 'char *' but argument is of type 'u_char * {aka unsigned char *}'
     dos_checksum(char *name, char *ext)
     ^~~~~~~~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:476:32: error: pointer targets in passing argument 2 of 'dos_checksum' differ in signedness [-Werror=pointer-sign]
       x = dos_checksum(dd.de.name, dd.de.ext);
                                    ^~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:406:1: note: expected 'char *' but argument is of type 'u_char * {aka unsigned char *}'
     dos_checksum(char *name, char *ext)
     ^~~~~~~~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c: In function 'lookup':
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:631:25: error: pointer targets in passing argument 1 of 'dos_checksum' differ in signedness [-Werror=pointer-sign]
            x = dos_checksum(dir[ent].de.name, dir[ent].de.ext);
                             ^~~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:406:1: note: expected 'char *' but argument is of type 'u_char * {aka unsigned char *}'
     dos_checksum(char *name, char *ext)
     ^~~~~~~~~~~~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:631:43: error: pointer targets in passing argument 2 of 'dos_checksum' differ in signedness [-Werror=pointer-sign]
            x = dos_checksum(dir[ent].de.name, dir[ent].de.ext);
                                               ^~~
    /code/illumos-gate/usr/src/boot/lib/libstand/dosfs.c:406:1: note: expected 'char *' but argument is of type 'u_char * {aka unsigned char *}'
     dos_checksum(char *name, char *ext)
     ^~~~~~~~~~~~

    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk almost 3 years ago

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

git commit 380059927f2f5af9148793463b305037707f8613

commit  380059927f2f5af9148793463b305037707f8613
Author: Toomas Soome <tsoome@me.com>
Date:   2018-08-09T15:05:38.000Z

    9708 loader: libstand warning: pointer targets differ in signedness
    Reviewed by: Yuri Pankov <yuripv@yuripv.net>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF