Project

General

Profile

Bug #11735

cardbus: cast between incompatible function types

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 8:

    ../../common/io/cardbus/cardbus.c: In function 'cardbus_enable_intr_impl':
    ../../common/io/cardbus/cardbus.c:2297:16: error: cast between incompatible function types from 'uint_t (*)(char *, char *)' {aka 'unsigned int (*)(char *, char *)'} to 'int (*)(int,  ...)' [-Werror=cast-function-type]
      sih.handler = (f_tt *)hdlp->ih_cb_func;
                    ^
    ../../common/io/cardbus/cardbus.c: In function 'cardbus_disable_intr_impl':
    ../../common/io/cardbus/cardbus.c:2333:16: error: cast between incompatible function types from 'uint_t (*)(char *, char *)' {aka 'unsigned int (*)(char *, char *)'} to 'int (*)(int,  ...)' [-Werror=cast-function-type]
      cih.handler = (f_tt *)hdlp->ih_cb_func;
                    ^
    ../../common/io/cardbus/cardbus_hp.c:1690:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "VendorId    =", 0, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1691:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "DeviceId    =", 2, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1692:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Command     =", 4, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1693:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Status      =", 6, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1694:30: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Latency     =", 0xd, (int(*)())pci_config_get8, "%s 0x%02x" },
                                  ^
    ../../common/io/cardbus/cardbus_hp.c:1701:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "ILINE       =", 0x3c, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1702:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "IPIN        =", 0x3d, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1707:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "VendorId    =", 0, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1708:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "DeviceId    =", 2, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1709:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Command     =", 4, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1710:28: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Status      =", 6, (int(*)())pci_config_get16, "%s 0x%04x" },
                                ^
    ../../common/io/cardbus/cardbus_hp.c:1711:30: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "CacheLineSz =", 0xc, (int(*)())pci_config_get8, "%s 0x%02x" },
                                  ^
    ../../common/io/cardbus/cardbus_hp.c:1712:30: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Latency     =", 0xd, (int(*)())pci_config_get8, "%s 0x%02x" },
                                  ^
    ../../common/io/cardbus/cardbus_hp.c:1714:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Pri Bus     =", 0x18, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1715:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Sec Bus     =", 0x19, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1716:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Sub Bus     =", 0x1a, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1717:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "CBus Latency=", 0x1b, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1726:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "ILINE       =", 0x3c, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1727:31: error: cast between incompatible function types from 'uint8_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'unsigned char (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "IPIN        =", 0x3d, (int(*)())pci_config_get8, "%s 0x%02x" },
                                   ^
    ../../common/io/cardbus/cardbus_hp.c:1728:31: error: cast between incompatible function types from 'uint16_t (*)(struct __ddi_acc_handle *, off_t)' {aka 'short unsigned int (*)(struct __ddi_acc_handle *, long int)'} to 'int (*)()' [-Werror=cast-function-type]
          { "Bridge Ctrl =", 0x3e, (int(*)())pci_config_get16, "%s 0x%04x" },
                                   ^
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk about 1 year ago

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

git commit 647709cb33adbc9ec046fb9ad41818ffc50b0bf3

commit  647709cb33adbc9ec046fb9ad41818ffc50b0bf3
Author: Toomas Soome <tsoome@me.com>
Date:   2019-10-01T09:44:27.000Z

    11735 cardbus: cast between incompatible function types
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF