8398 pcmcia: sizeof on array function parameter

Review Request #588 — Created June 15, 2017 and submitted

tsoome
illumos-gate
8398
e7c0c84...
general
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


  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
marcel
  1. 
      
  2. usr/src/uts/common/sys/pcmcia.h (Diff revision 1)
     
     

    Minor nit: Please add a space around /.

  3. 
      
marcel
  1. 
      
  2. Please remove extra space.

  3. 
      
marcel
  1. Ship It!
  2. 
      
andy_js
  1. How odd.

  2. 
      
tsoome
marcel
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...