detect: fix SCTime_t -Wshorten-64-to-32 warnings#13189
detect: fix SCTime_t -Wshorten-64-to-32 warnings#13189catenacyber wants to merge 1 commit intoOISF:masterfrom
Conversation
Ticket: OISF#6186 SCTime_t has seconds defined as 44 bits of a u64, so we use u64 for everything in seconds now.
|
Draft : some format strings to fix also apparently |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13189 +/- ##
==========================================
+ Coverage 83.11% 83.12% +0.01%
==========================================
Files 988 988
Lines 272222 272222
==========================================
+ Hits 226253 226290 +37
+ Misses 45969 45932 -37
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Many of the structs use a uint32_t for secs to save space. So using a uint64_t will grow the structs w/o a real benefit. If u32 isn't enough, we need to convert to SCTime_t instead of uint64_t |
So, the question is wether they should keep u32 to save space but then check overflows, or use SCTime_t/uint64_t The benefit here is to have a correct computation when u32 overflows.
I try next branch with SCTime_t |
|
Next in #13203 |
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6186
Describe changes:
-Wshorten-64-to-32warnings for remaining files : detect@jlucovsky how does that look to you ? (as you did 31793af )
#13159 next iteration with new warnings getting fixed
Still to do afterwards :