Bug #8395

mr_sas: sizeof on array function parameter will return size of pointer

Added by Toomas Soome 2 months ago. Updated 26 days ago.

Status:ClosedStart date:2017-06-15
Priority:NormalDue date:
Assignee:Toomas Soome% Done:

100%

Category:driver - device drivers
Target version:-
Difficulty:Medium Tags:

Description

Build error from gcc 6:

../../common/io/mr_sas/mr_sas_tbolt.c:3012:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument]
   bzero(cdb, sizeof (cdb));
                     ^
../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here
 mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk,
                           ^~~
../../common/io/mr_sas/mr_sas_tbolt.c:3045:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument]
   bzero(cdb, sizeof (cdb));
                     ^
../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here
 mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk,
                           ^~~
../../common/io/mr_sas/mr_sas_tbolt.c:3065:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument]
   bzero(cdb, sizeof (cdb));
                     ^
../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here
 mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk,
                           ^~~
cc1: all warnings being treated as errors

History

#1 Updated by Electric Monk 26 days ago

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

git commit 3344ffb75c0f6746eb694e4389f752801e9c7a4e

commit  3344ffb75c0f6746eb694e4389f752801e9c7a4e
Author: Toomas Soome <tsoome@me.com>
Date:   2017-07-25T18:33:45.000Z

    8395 mr_sas: sizeof on array function parameter will return size of pointer
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Marcel Telka <marcel@telka.sk>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom