../asc2log.c:264:8: warning: implicit declaration of function 'strcasestr' is invalid in C99 [-Wimplicit-function-declaration]
ptr = strcasestr(buf, tmp1);
^
../asc2log.c:264:6: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
ptr = strcasestr(buf, tmp1);
^ ~~~~~~~~~~~~~~~~~~~~~
../asc2log.c:328:6: warning: implicit declaration of function 'strcasestr' is invalid in C99 [-Wimplicit-function-declaration]
if (strcasestr(date, " pm ") != NULL) {
^
../asc2log.c:328:31: warning: comparison between pointer and integer ('int' and 'void *') [-Wpointer-integer-compare]
if (strcasestr(date, " pm ") != NULL) {
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
../asc2log.c:336:8: warning: implicit declaration of function 'strptime' is invalid in C99 [-Wimplicit-function-declaration]
if (!strptime(date, "%B %d %I:%M:%S %p %Y", &tms)) {
^
../asc2log.c:354:8: warning: implicit declaration of function 'strptime' is invalid in C99 [-Wimplicit-function-declaration]
if (!strptime(date, "%B %d %H:%M:%S %Y", &tms)) {
../slcanpty.c:476:7: warning: implicit declaration of function 'grantpt' is invalid in C99 [-Wimplicit-function-declaration]
if (grantpt(p) < 0) {
^
../slcanpty.c:481:7: warning: implicit declaration of function 'unlockpt' is invalid in C99 [-Wimplicit-function-declaration]
if (unlockpt(p) < 0) {
^
../slcanpty.c:486:14: warning: implicit declaration of function 'ptsname' is invalid in C99 [-Wimplicit-function-declaration]
name_pts = ptsname(p);
^
../slcanpty.c:486:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
name_pts = ptsname(p);
^ ~~~~~~~~~~
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
although it looks like a false positive:
/home/travis/build/linux-can/can-utils/j1939cat.c: In function ‘main’:
/home/travis/build/linux-can/can-utils/j1939cat.c:648:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int ret;
^
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
although it looks like a false positive:
/home/travis/build/linux-can/can-utils/can-calc-bit-timing.c: In function ‘print_bit_timing.isra.6’:
/home/travis/build/linux-can/can-utils/can-calc-bit-timing.c:447:42: warning: ‘tseg2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^
/home/travis/build/linux-can/can-utils/can-calc-bit-timing.c:447:35: warning: ‘tseg1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Fix missing (recently introduced) j1939 files that have not been fixed
in commit 43610bd621 ("Fix arithmetic on a pointer warning") from
Gary Bisson.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Fix missing (recently introduced) j1939 files that have not been fixed
in commit 46895a41c5 ("Fix comparison type mismatch warnings") from
Gary Bisson.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
open_socket() has a parameter to provide a network device name which
is properly assigned by its callers to s.intf in main().
Instead of using the callers value open_socket() directly accesses the
global s.intf which generates an unused variable warning with clang.
Fix this by using the provided parameter (no functional change).
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Some debug messages were implemented using err(), which does not return,
but exit the program. This patches replaces the debug messages by
fprintf(stdout, ).
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Android now uses clang with Werror by default which prevents from
building.
Removing Werror for the current warnings.
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
As pointed out by Gary Bisson clang complains about unused variables in
some valid cases.
Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
While strptime() does not support fractions of seconds in the date/time
string some new asc files support the milliseconds resolution.
When detecting this new format the msecs are retrieved by a separate
sscanf() invocation and added to the timeval's tv_usec element.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Detailed change log:
log2asc:
- support CAN FD tags and Classic CAN frames
- support RTR frames including DLC values
- new option '-r' disable the RTR DLC value for potential compatibility reasons
- new option '-f' to use the CANFD format for Classic CAN too
asc2log:
- support CAN FD tags and Classic CAN frames
- be robust against fractions of seconds in date/time string
- fix reading of RTR frames including DLC values in Classic CAN parsing
- fix date/time string detection
cangen:
- new option '-E' to support ESI bit for CAN FD frame generation
(was needed for reference log file generation)