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

Fix -Wimplicit-function-declaration on FreeBSD #23

Closed
wants to merge 1 commit into from
Closed

Fix -Wimplicit-function-declaration on FreeBSD #23

wants to merge 1 commit into from

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Feb 14, 2022

According to POSIX.1-2008 (compare with POSIX.1-2001) gettimeofday is OB XSI ("Obsolescent" + "X/Open System Interfaces"). XSI etxensions are provided by _XOPEN_SOURCE, a superset of _POSIX_C_SOURCE.

src/viewer.c:273:5: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
src/window.c:96:5: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
@artemsen
Copy link
Owner

The gettimeofday() function is deprecated and I planned to replace it with a clock_gettime() call.
I don't mind this patch, but could you add Signed-off-by to your commit?

artemsen added a commit that referenced this pull request Feb 17, 2022
Th function gettimeofday() is deprecated and should not be used.

Relates to #23.

Signed-off-by: Artem Senichev <artemsen@gmail.com>
@artemsen
Copy link
Owner

The gettimeofday() function replaced with clock_gettime().

@artemsen artemsen closed this Feb 17, 2022
@jbeich jbeich deleted the freebsd branch February 18, 2022 14:33
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.

None yet

2 participants