Project

General

Profile

Bug #11591

usbser: cast between incompatible function types

Added by Toomas Soome 11 months ago. Updated 10 months 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:

    In file included from ../../common/io/usb/clients/usbser/usbser.c:57:
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:320:2: note: in expansion of macro 'RSEQ'
      RSEQ(NULL,   usbser_free_soft_state),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:35: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:321:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_init_soft_state, usbser_fini_soft_state),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:321:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_init_soft_state, usbser_fini_soft_state),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:35: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:322:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_attach_dev,  usbser_detach_dev),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'void (*)(usbser_state_t *)' {aka 'void (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:322:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_attach_dev,  usbser_detach_dev),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:35: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:323:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_attach_ports, usbser_detach_ports),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'void (*)(usbser_state_t *)' {aka 'void (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:323:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_attach_ports, usbser_detach_ports),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'int (*)(usbser_state_t *)' {aka 'int (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:35: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:324:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_create_taskq, usbser_destroy_taskq),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'void (*)(usbser_state_t *)' {aka 'void (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:324:2: note: in expansion of macro 'RSEQ'
      RSEQ(usbser_create_taskq, usbser_destroy_taskq),
      ^~~~
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:145:27: error: cast between incompatible function types from 'void (*)(usbser_state_t *)' {aka 'void (*)(struct usbser_state *)'} to 'uintptr_t (*)(uintptr_t)' {aka 'long unsigned int (*)(long unsigned int)'} [-Werror=cast-function-type]
     #define RSEQT(func, cb) { (rseq_func_t)(func), #func, (rseq_cb_t)(cb), 0 }
                               ^
    ../../common/sys/usb/clients/usbser/usbser_rseq.h:146:51: note: in expansion of macro 'RSEQT'
     #define RSEQE(f1, cb1, f2, cb2) { RSEQT(f1, cb1), RSEQT(f2, cb2) }
                                                       ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:223:22: note: in expansion of macro 'RSEQE'
     #define RSEQ(f1, f2) RSEQE(f1, usbser_rseq_do_cb, f2, NULL)
                          ^~~~~
    ../../common/io/usb/clients/usbser/usbser.c:325:2: note: in expansion of macro 'RSEQ'
      RSEQ(NULL,   usbser_set_dev_state_init)
      ^~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 10 months ago

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

git commit b79609a5823c681de453be676098d9635305e6a7

commit  b79609a5823c681de453be676098d9635305e6a7
Author: Toomas Soome <tsoome@me.com>
Date:   2019-09-20T09:53:55.000Z

    11591 usbser: cast between incompatible function types
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Aurélien Larcher <aurelien.larcher@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF