mirror of https://github.com/ARMmbed/mbed-os.git
Resolved compiler error: constructor deleted
IAR 8.x compiler throws error for emac_interface_t constructor rtw_emac.cpp@220,0: [Pe1790]: the default constructor of "emac_interface" cannot be referenced -- it is a deleted function Error is because new object is created of structure with constant member. Resolved it by using malloc instead new.pull/4938/head
parent
7d98eebf2a
commit
d12822f95a
|
@ -217,7 +217,7 @@ emac_interface_t *wlan_emac_init_interface()
|
|||
{
|
||||
|
||||
if (_emac == NULL) {
|
||||
_emac = new emac_interface_t();
|
||||
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
|
||||
if (_emac == NULL) {//new emac_interface_t fail
|
||||
printf("emac initialization failed\r\n");
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue