Вобщем в си все нормально, но вот, когда решил скомпилипровать код в С++
Код |
#define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
/* USB Endpoint Events Callback Pointers */ void (* const USB_P_EP[16]) (U32 event) = { P_EP(0), P_EP(1), P_EP(2), P_EP(3), P_EP(4), P_EP(5), P_EP(6), P_EP(7), P_EP(8), P_EP(9), P_EP(10), P_EP(11), P_EP(12), P_EP(13), P_EP(14), P_EP(15), };
|
ахтунг ааа
Код | usbuser.c(168): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(168): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(169): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(169): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(170): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(170): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(171): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(171): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(172): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(172): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(173): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(173): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(174): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(174): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(175): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(175): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(176): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(176): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(177): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(177): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(178): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(178): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(179): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(179): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(180): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(180): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(181): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(181): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(182): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(182): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)" usbuser.c(183): warning: #42-D: operand types are incompatible ("void (*)(U32)" and "void *") usbuser.c(183): error: #144: a value of type "void *" cannot be used to initialize an entity of type "void (*const)(U32)"
|
Почему, что компилятору не нравиться, на си всёж работало??? |