The struct timeval should contain two members of types time_t and suseconds_t , according to spec:
time_t tv_sec seconds suseconds_t tv_usec microseconds
but in header {underscore}timeval.h where is structure defined are both types as long.
This inconsistency is causing warnings in cross-platform code.
Hello,
that here we use long is by intention. The declaration of this timeval
structure is (was) inconsistent c-runtime vs Windows SDK in context of
gcc. Therefore we made sure to use underlying base types instead. The
use of "long" is mainly caused by compatibility with Cygwin. As for
Cygwin this structure has 64-bit members (instead of 32-bit ones as
for native Windows).
To understand your issue, it would be interesting if you could provide
small testcase, and a description of used compiler, and how it get
invoked.
Cheers,
Kai
Am Mo., 28. Jan. 2019 um 13:15 Uhr schrieb Lukas Kucera
kerbos@users.sourceforge.net:
Related
Bugs: #783
Dear developer,
thank you for the fast response and clarification of the inconsistency.
It's not a big issue and I can live with this feature, so I won't provide a
test case.
Best regards,
Lukas Kucera
--
Lukáš Kučera
From: Kai Tietz ktietz70@users.sourceforge.net
Sent: Tuesday, January 29, 2019 10:37 AM
To: [mingw-w64:bugs] 783@bugs.mingw-w64.p.re.sourceforge.net
Subject: [mingw-w64:bugs] Re: #783 incorrect types in struct timeval
Hello,
that here we use long is by intention. The declaration of this timeval
structure is (was) inconsistent c-runtime vs Windows SDK in context of
gcc. Therefore we made sure to use underlying base types instead. The
use of "long" is mainly caused by compatibility with Cygwin. As for
Cygwin this structure has 64-bit members (instead of 32-bit ones as
for native Windows).
To understand your issue, it would be interesting if you could provide
small testcase, and a description of used compiler, and how it get
invoked.
Cheers,
Kai
Am Mo., 28. Jan. 2019 um 13:15 Uhr schrieb Lukas Kucera
kerbos@users.sourceforge.net kerbos@users.sourceforge.net :
[bugs:#783] https://sourceforge.net/p/mingw-w64/bugs/783/ incorrect types
in struct timeval
Status: open
Group: v1.0 (example)
Labels: timeval
Created: Mon Jan 28, 2019 12:15 PM UTC by Lukas Kucera
Last Updated: Mon Jan 28, 2019 12:15 PM UTC
Owner: nobody
The struct timeval should contain two members of types time_t and
suseconds_t , according to spec:
time_t tv_sec seconds
suseconds_t tv_usec microseconds
but in header {underscore}timeval.h where is structure defined are both
types as long.
This inconsistency is causing warnings in cross-platform code.
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/mingw-w64/bugs/783/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
[bugs:#783] https://sourceforge.net/p/mingw-w64/bugs/783/ incorrect types
in struct timeval
Status: open
Group: v1.0 (example)
Labels: timeval
Created: Mon Jan 28, 2019 12:15 PM UTC by Lukas Kucera
Last Updated: Mon Jan 28, 2019 12:15 PM UTC
Owner: nobody
The struct timeval should contain two members of types time_t and
suseconds_t , according to spec:
time_t tv_sec seconds
suseconds_t tv_usec microseconds
but in header {underscore}timeval.h where is structure defined are both
types as long.
This inconsistency is causing warnings in cross-platform code.
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/mingw-w64/bugs/783/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
Related
Bugs: #783
I can't speak for the reporter, but I ran into this issue with the following code:
This is MinGW 8.0.0 with MinGW GCC 10.2.1 (I'm not on Debian, but I used packages from Debian sid, I believe). Since
localtime
takes atime_t
, it's expecting a 64-bit value, but by makingtv_sec
along
, there's an incompatibility.