PiInTheSky / lora-gateway

LoRa gateway to Habitat
96 stars 69 forks source link

server.c: Initialise pointers to remove GCC warning on some optimisation levels #48

Closed philcrump closed 6 years ago

philcrump commented 6 years ago

Compiling under debugger-friendly optimisation produces the following GCC warnings:

gcc -Wall -Og -ggdb -o server.o -c server.c server.c: In function ‘ProcessJSONClientLine’: server.c:74:14: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized] channel = *value != '0'; ^~ server.c:70:7: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (strcasecmp(command, "send") == 0) ^~~~~~~ server.c:60:3: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized] SetConfigValue(setting, value); ^~~~~~~~~~ server.c:60:3: warning: ‘s’ may be used uninitialized in this function [-Wmaybe-uninitialized]

I suspect these are a minor gcc bug, but harmlessly initialising the 'saveptr' pointer removes the warnings.

philcrump commented 6 years ago

Folded into #50