ARMmbed / wifi-x-nucleo-idw01m1

X-NUCLEO-IDW0xx1 Wi-Fi Driver
3 stars 8 forks source link

Build failures on ARM compiler 5 and IAR 7 #7

Closed SeppoTakalo closed 6 years ago

SeppoTakalo commented 6 years ago

I spotted from my CI runs that after latest changes, the master of this driver is broken on ARM and IAR

22:22:58 Compile [ 99.1%]: SPWFSAxx.cpp
22:22:58 [Warning] SPWFSA01.h@62,0:  #1300-D: _read_in inherits implicit virtual
22:22:58 
[Error] SPWFSAxx.cpp@341,0:  #20: identifier "index" is undefined

@betzw Please check.

betzw commented 6 years ago

The warning should be easy to solve. Regarding the compilation error I would like to ask your help: Unfortunately, I do not have access to ARM a/o IAR, so could you pls. try to re-compile again after substituting in file SPWFSAxx.cpp call index(...) with a call to strchr(...)?

Thanks in advance!

SeppoTakalo commented 6 years ago

It should work as index() is marked LEGACY in C standards and should be replaced with strchr() http://pubs.opengroup.org/onlinepubs/009695399/functions/index.html

I'll check

betzw commented 6 years ago

Thanks and sorry for the inconvenience :flushed:

SeppoTakalo commented 6 years ago

Yes, it seems to fix the build at least on ARM. My IAR setup is not in working condition.

So only change required to replace index() with strchr()

        if(_parser.recv("%[^\n]\n", _msg_buffer) && _recv_delim_lf())
        {
            if(strstr(_msg_buffer, ":24:") != NULL) { // WiFi Up
                debug_if(_dbg_on, "AT^ %s\n", _msg_buffer);
                if(strchr(_msg_buffer, '.') != NULL) { // IPv4 address
                    break;
                } else {
                    continue;
                }
betzw commented 6 years ago

Will come up with a new master branch commit asap!

betzw commented 6 years ago

Done.

SeppoTakalo commented 6 years ago

Fixed.