Project

General

Profile

Bug #10298

pcmcia: cast between incompatible function types

Added by Toomas Soome 11 months ago. Updated 11 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build error with gcc 8:

    ../../common/pcmcia/cs/cs_stubs.c: In function 'csx_register_cardservices':
    ../../common/pcmcia/cs/cs_stubs.c:157:18: error: cast between incompatible function types from 'int (*)(void)' to 'int32_t (*)(int32_t,  ...)' {aka 'int (*)(int,  ...)'} [-Werror=cast-function-type]
       cardservices = (csfunction_t *)cs_no_carservices;
                      ^
    ../../common/pcmcia/nexus/pcmcia.c:387:23: error: cast between incompatible function types from 'void * (*)(int,  ...)' to 'int (*)(int,  ...)' [-Werror=cast-function-type]
       pcmcia_cis_parser = (f_tt *)CISParser;
                           ^
    ../../common/pcmcia/nexus/pcmcia.c: In function 'pcmcia_set_em_handler':
    ../../common/pcmcia/nexus/pcmcia.c:1747:23: error: cast between incompatible function types from 'int (*)()' to 'void (*)()' [-Werror=cast-function-type]
       mif->mif_function = (void (*)())handler;
                           ^
    ../../common/pcmcia/nexus/pcmcia.c: In function 'SSSetIRQHandler':
    ../../common/pcmcia/nexus/pcmcia.c:3818:6: error: cast between incompatible function types from 'int (*)(int,  ...)' to 'uint32_t (*)(char *)' {aka 'unsigned int (*)(char *)'} [-Werror=cast-function-type]
          (uint32_t(*)(caddr_t)) handler->handler,
          ^
    ../../common/pcmcia/nexus/pcmcia.c: In function 'pcmcia_intr_enable_isr':
    ../../common/pcmcia/nexus/pcmcia.c:5295:20: error: cast between incompatible function types from 'uint_t (*)(char *, char *)' {aka 'unsigned int (*)(char *, char *)'} to 'int (*)(int,  ...)' [-Werror=cast-function-type]
      handler.handler = (f_tt *)hdlp->ih_cb_func;
                        ^
    cc1: all warnings being treated as errors

To fix, declare proper argument list.

History

#1

Updated by Toomas Soome 11 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 11 months ago

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

git commit ebf373523fbbfcc7f9f0b7e35f0e82fac5492cfe

commit  ebf373523fbbfcc7f9f0b7e35f0e82fac5492cfe
Author: Toomas Soome <tsoome@me.com>
Date:   2019-01-31T22:04:30.000Z

    10298 pcmcia: cast between incompatible function types
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Hans Rosenfeld <hans.rosenfeld@joyent.com>

Also available in: Atom PDF