ty4tw / AsyncMQTT-SN

MQTT-SN Async Client and Gateway for Arduino and linux.
48 stars 14 forks source link

Cannot compile AsyncClient #5

Open Serphentas opened 1 year ago

Serphentas commented 1 year ago

In TaskManager.cpp, this line is causing trouble with g++ (GCC) 13.1.1 20230429:

src/lib/TaskManager.cpp: In member function ‘void tomyAsyncClient::TaskManager::run()’:
src/lib/TaskManager.cpp:74:57: error: ordered comparison of pointer with integer zero (‘void (*)()’ and ‘int’)
   74 |                 for (_index = 0; _task[_index].callback > 0; _index++){
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~

Changing in with this syntax clears the problem, but I'm not sure if this is the correct way to go with pointers:

for (_index = 0; _task[_index].callback != NULL; _index++){