You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A potential source of bugs - and one of the reasons the MSVC debug CIs hangs / displays a runtime checker popup - is the use of the long type , whose size differs in 64-bit mode on MSVC (4 bytes) vs "rest of the world" compilers (8 bytes).
(nitpicker's corner: okay, there might be a few other exceptions)
As an example, the test FUNCTION RANDOM fails here (intrinsic.c:cob_intr_random) :
Indeed, a 64-bit pointer won't fit in a 32-bit long, and the MSVC runtime checker will complain.
Wherever the size matters, I'd suggest using the C99 fixed width integer types (u)int64_t - providing a custom definition when missing. Or, we could just use cob_u64_t / cob_s64_t.
(nitpicker's corner bis: yeah, for a pointer the proper cast would be to (u)intptr_t, not (u)int64_t)
Thoughts ?
The text was updated successfully, but these errors were encountered:
A potential source of bugs - and one of the reasons the MSVC debug CIs hangs / displays a runtime checker popup - is the use of the
long
type , whose size differs in 64-bit mode on MSVC (4 bytes) vs "rest of the world" compilers (8 bytes).(nitpicker's corner: okay, there might be a few other exceptions)
As an example, the test
FUNCTION RANDOM
fails here (intrinsic.c:cob_intr_random
) :Indeed, a 64-bit pointer won't fit in a 32-bit long, and the MSVC runtime checker will complain.
Wherever the size matters, I'd suggest using the C99 fixed width integer types
(u)int64_t
- providing a custom definition when missing. Or, we could just usecob_u64_t
/cob_s64_t
.(nitpicker's corner bis: yeah, for a pointer the proper cast would be to
(u)intptr_t
, not(u)int64_t
)Thoughts ?
The text was updated successfully, but these errors were encountered: