Overview
| Artifact ID: | ed6aaa4b7bbfee8716464c9f25fd045a4743a5b3c367eec9e6b50853ab5eb831 |
|---|---|
| Ticket: | 167e0635db79f05d23d766376f6eed32b1572451
`make valgrind` detections |
| User & Date: | sebres on 2024-04-09 18:47:11 |
Changes
- icomment:
> Why are you collecting the `baseObj` in the `ClockFmtScnCmdArgs` when it's only ever used in the same function ... In my own engine (where I back-ported it from), baseVal (date->seconds) is converted to seconds (and others parts) on demand, e. g. to bypass unneeded conversions through the TZ etc, for instance if the whole date is specified in input string. Also it is used additionally on few other functions, since, on my side, this object is not necessarily an integer but can be clock-seconds (special type), previously got from another clock-scan calls (e. g. to format it or use as another base).<br/> Because it was too complex and also too different (since core-tcl's object can shimmer, cannot be converted from some type to integer without interim string-representation etc), I decided not to provide that logic firstly. However this mentioned "on demand conversion" can be surely done later (e. g. it could speed-up scans like `clock scan "2020-01-01 00:00:00"` with totally unneeded base). Anyway, I don't think it bothers somehow (moreover may help by some deep debug on a conditional BP etc)... And it's definitely not the problem that valgrind complains, because initially opts.baseObj pointer is 0 (by memset via ClockInitFmtScnArgs) and the supposed place where valgrind means it'd be uninitialized is a condition over content of it (bytes & length), which shall be always initialized in properly created tcl-object (no matter it'd be local or belong to some structure). As already said it is not explainable to me, and I hoped to reproduce it to go deeper, just unsuccessful.<br/> Could you reproduce it with your valgrind, Donal?
- login: "sebres"
- mimetype: "text/x-markdown"