GCC Compiler Warnings in Util #20

Closed
opened 2023-12-02 02:04:57 +00:00 by uis · 0 comments

GCC 12, ARMv7a.

src/Util.c:84:36: warning: right shift count >= width of type [-Wshift-count-overflow]

   84 |         UInt32 high = (UInt32) (ms >> 32);

Same for line 115.

src/Util.c:212:46: warning: left shift count >= width of type [-Wshift-count-overflow]
  212 |         ts.tv_sec = ((time_t) UInt64High(ms) << 32 | UInt64Low(ms)) / 1000;

Shouldn't shift left and or replaced with 64-bin macros?

As I understand time_t is defined as 32-bit variable.

GCC 12, ARMv7a. ``` src/Util.c:84:36: warning: right shift count >= width of type [-Wshift-count-overflow] 84 | UInt32 high = (UInt32) (ms >> 32); ``` Same for line 115. ``` src/Util.c:212:46: warning: left shift count >= width of type [-Wshift-count-overflow] 212 | ts.tv_sec = ((time_t) UInt64High(ms) << 32 | UInt64Low(ms)) / 1000; ``` Shouldn't shift left and or replaced with 64-bin macros? As I understand time_t is defined as 32-bit variable.
jordan added the
bug
label 2023-12-02 14:55:27 +00:00
jordan added this to the Cytoplasm v0.4.1 milestone 2023-12-02 15:27:12 +00:00
jordan referenced this issue from a commit 2024-01-13 22:13:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Telodendria/Cytoplasm#20
No description provided.