Project

General

Profile

Actions

Bug #6135

open

printf anomalie in usr/src/cmd/scsi/smp/common/smp.c

Added by Richard PALO about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-08-18
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

note the printf statement folloiwing:

    case SMP_FUNC_REPORT_BROADCAST: {
        smp_report_broadcast_resp_t *brp =
            (smp_report_broadcast_resp_t *)smp_resp;
        smp_broadcast_descr_t *bdp = &brp->srbr_descrs[0];
        uint16_t bcount, idx;
        uint8_t bctype;

        bcount = brp->srbr_number_broadcast_descrs;

        (void) printf("\tNumber of broadcast descriptors: %d\n",
            bcount);
        (void) printf("\t%7s %5s %5s %8s\n",
            "BCType", "PhyID", "BCRsn", "BC Count");
        for (idx = 0; idx < bcount; idx++) {
            (void) printf("\t%7s %5s %5s %8s\n",
                bdp->sbd_broadcast_type, bdp->sbd_phy_identifier,
                bdp->sbd_broadcast_reason,
                bdp->sbd_broadcast_count);
            bdp++;
        }

        break;
    }

lint is correct, indicating:

"/home/richard/src/illumos-gate/usr/src/cmd/scsi/smp/common/smp.c", line 763: warning: function argument type inconsistent with format: printf(arg 2) int  and (format) char * in smp.c(763) (E_BAD_FORMAT_ARG_TYPE2)
"/home/richard/src/illumos-gate/usr/src/cmd/scsi/smp/common/smp.c", line 763: warning: function argument type inconsistent with format: printf(arg 3) int  and (format) char * in smp.c(763) (E_BAD_FORMAT_ARG_TYPE2)
"/home/richard/src/illumos-gate/usr/src/cmd/scsi/smp/common/smp.c", line 763: warning: function argument type inconsistent with format: printf(arg 4) int  and (format) char * in smp.c(763) (E_BAD_FORMAT_ARG_TYPE2)
"/home/richard/src/illumos-gate/usr/src/cmd/scsi/smp/common/smp.c", line 763: warning: function argument type inconsistent with format: printf(arg 5) int  and (format) char * in smp.c(763) (E_BAD_FORMAT_ARG_TYPE2)

as seen by the struct type definition:

384typedef struct smp_broadcast_descr {
385    DECL_BITFIELD2(
386        sbd_broadcast_type        :4,
387        _reserved1            :4);
388    uint8_t sbd_phy_identifier;
389    DECL_BITFIELD2(
390        sbd_broadcast_reason    :4,
391        _reserved2            :4);
392    uint16_t sbd_broadcast_count;
393    uint8_t _reserved3[10];
394} smp_broadcast_descr_t;

No data to display

Actions

Also available in: Atom PDF