Project

General

Profile

Actions

Bug #11591

closed

usbser: cast between incompatible function types

Added by Toomas Soome over 4 years ago. Updated about 4 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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

Actions

Also available in: Atom PDF