On 07/04/2020 23:50, Gary E. Miller
wrote:
Yo All!
Ugh. I found the problem with arm32 and test/daemon/bundg_zeus_9.log.
driver_nmea0183 now has more cycle enders than there are bits in a uint64_t.
Coverity spotted the bug as soon as the new NMEA sentences were added:
_____________________________________________________________________
*** CID 292260: Integer handling issues (BAD_SHIFT)
/driver_nmea0183.c: 3601 in nmea_parse()
3595 (unsigned long long)session->nmea.cycle_enders);
3596 lasttag = session->nmea.lasttag;
3597 if (0 < session->nmea.lasttag) {
3598 lasttag_mask = (uint64_t)1 << lasttag;
3599 }
3600 if (0 < thistag) {
CID 292260: Integer handling issues (BAD_SHIFT)
In _expression_ "1UL << thistag", left shifting by more than 63 bits has undefined behavior. The shift amount, "thistag", is as much as 70.
3601 thistag_mask = (uint64_t)1 << thistag;
3602 }
3603 if (session->nmea.latch_frac_time) {
3604 timespec_t ts_delta;
3605 TS_SUB(&ts_delta, &session->nmea.this_frac_time,
3606 &session->nmea.last_frac_time);
_____________________________________________________________________
Before I change the algorithm to a different method, create a new set of
bugs, can I just use uint128_t? Or are there arches that do not have
uint128_t?
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
--
Michael J Tubby B.Sc. (Hons) MIET / Technical Director
Email: address@hidden
Direct: +44 (0)1905 752892
Mobile: +44 (0)7973 225144
Thorcom Systems Limited
Office: +44 (0)1905 756 700
Unit 4, 96B Blackpole Trading Estate West,
Worcester, WR3 8TJ, England, UK
Registered in England & Wales 02704696 /
VAT Number GB487925681
This email and any attachments to it may be
confidential or legally privileged and are intended solely the
individual to whom it is addressed.
If you are not the intended recipient of this email, you must
not take any action based upon its contents or disclose its
contents to any third-party.
This email footer is intended to identify the sender and does
not constitute a signature or agreement to enter into any form
of legally binding contract.
While the author has taken reasonable care in the preparation of
this email Errors and Omissions Excepted (E&OE).
Any views or opinions expressed are those of the author and do
not necessarily represent those of Thorcom Systems Limited.
Please contact the sender if you believe you have received this
email in error.