Actions
Bug #8398
closedpcmcia: sizeof on array function parameter
Start date:
2017-06-15
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
Build error with gcc 6:
In file included from ../../common/pcmcia/nexus/pcmcia.c:64:0: ../../common/pcmcia/nexus/pcmcia.c: In function 'pcm_fix_bits': ../../common/sys/pcmcia.h:286:50: error: 'sizeof' on array function parameter 'dst' will return size of 'uchar_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] #define PR_ZERO(map) bzero((caddr_t)map, sizeof (map)) ^ ../../common/pcmcia/nexus/pcmcia.c:1774:2: note: in expansion of macro 'PR_ZERO' PR_ZERO(dst); ^~~~~~~ ../../common/pcmcia/nexus/pcmcia.c:1770:47: note: declared here pcm_fix_bits(socket_enum_t src, socket_enum_t dst, int num, int dir) ^~~ ../../common/pcmcia/nexus/pcmcia.c:1778:28: error: 'sizeof' on array function parameter 'dst' will return size of 'uchar_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] for (i = 0; i <= (sizeof (dst) * PR_WORDSIZE) - num; i++) { ^ ../../common/pcmcia/nexus/pcmcia.c:1770:47: note: declared here pcm_fix_bits(socket_enum_t src, socket_enum_t dst, int num, int dir) ^~~ ../../common/pcmcia/nexus/pcmcia.c:1784:28: error: 'sizeof' on array function parameter 'dst' will return size of 'uchar_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] for (i = num; i < sizeof (dst) * PR_WORDSIZE; i++) { ^ ../../common/pcmcia/nexus/pcmcia.c:1770:47: note: declared here pcm_fix_bits(socket_enum_t src, socket_enum_t dst, int num, int dir) ^~~ cc1: all warnings being treated as errors
Updated by Electric Monk about 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 24a150c1bcca7eba0f2d518d0f41645eb55f6066
commit 24a150c1bcca7eba0f2d518d0f41645eb55f6066 Author: Toomas Soome <tsoome@me.com> Date: 2017-06-19T14:34:11.000Z 8398 pcmcia: sizeof on array function parameter Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
Actions