SDM120C icon indicating copy to clipboard operation
SDM120C copied to clipboard

error when compiled

Open wifi75 opened this issue 4 years ago • 2 comments

hello on ubuntu server after send command make clean && make I get this error:

rm -f *.o sdm120c
gcc -c -o sdm120c.o sdm120c.c -O2 -Wall -g `pkg-config --cflags libmodbus`
sdm120c.c: In function ‘log_message’:
sdm120c.c:264:24: warning: format not a string literal and no format arguments [-Wformat-security]
        fprintf(stderr, buffer);
                        ^~~~~~
sdm120c.c:273:30: warning: format not a string literal and no format arguments [-Wformat-security]
             syslog(LOG_INFO, versionbuffer);
                              ^~~~~~~~~~~~~
sdm120c.c:276:30: warning: format not a string literal and no format arguments [-Wformat-security]
             syslog(LOG_INFO, parent);
                              ^~~~~~
sdm120c.c:277:30: warning: format not a string literal and no format arguments [-Wformat-security]
             syslog(LOG_INFO, cmdline);
                              ^~~~~~~
sdm120c.c:280:26: warning: format not a string literal and no format arguments [-Wformat-security]
         syslog(LOG_INFO, buffer);
                          ^~~~~~
gcc -o sdm120c sdm120c.o -O2 -Wall -g `pkg-config --libs libmodbus`
chmod 4711 sdm120c

what can I do?

wifi75 avatar Jul 29 '20 11:07 wifi75

sudo make install?

I don't see any errors, only warnings.

ehoutsma avatar Jul 29 '20 13:07 ehoutsma

With the updated version I think there is still an issue here: https://github.com/gianfrdp/SDM120C/blob/f36fb38c2f8985e2330ed2492178211d63542361/sdm120c.c#L279

asarubbo avatar Jan 22 '24 11:01 asarubbo