Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestamp formatting: always use 64-bit for timesstamp formatting. #473

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

tisyang
Copy link
Contributor

@tisyang tisyang commented Nov 27, 2023

Using C99 unsigned long long to format struct timeval's tv_sec and tv_usec, fix incorrect print under some 32bit platform which using time64.

To fix issue #469. It may looks ugly, but straightforward.

@tisyang tisyang mentioned this pull request Nov 27, 2023
@marckleinebudde
Copy link
Member

asc2log.c: In function ‘main’:
asc2log.c:438:31: warning: variable ‘tmp_tv’ set but not used [-Wunused-but-set-variable]
  438 |         static struct timeval tmp_tv; /* tmp frame timestamp from ASC file */
      |                               ^~~~~~

@tisyang
Copy link
Contributor Author

tisyang commented Nov 27, 2023

asc2log.c: In function ‘main’:
asc2log.c:438:31: warning: variable ‘tmp_tv’ set but not used [-Wunused-but-set-variable]
  438 |         static struct timeval tmp_tv; /* tmp frame timestamp from ASC file */
      |                               ^~~~~~

It seems that tmp_tv is only used for input check in code, set but not used. I will check again tomorrow and make some change to avoid warning.

Using C99 `unsigned long long` to format `struct timeval`'s `tv_sec`
and `tv_usec`, fix incorrect print under some 32bit platform which
 using time64.
@tisyang
Copy link
Contributor Author

tisyang commented Nov 28, 2023

@marckleinebudde source code has been updated to fix compile warning [-Wunused-but-set-variable] about tmp_tv.

@marckleinebudde marckleinebudde merged commit 2abf88c into linux-can:master Nov 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants