Menu

#646 Problem with chVTIsTimeWithinX()

3.0.3
closed
time (1)
Medium
3.0.2
True
2015-11-08
2015-10-10
lb
No

Hi
There is an issue with chVTIsTimeWithinX function, when CH_CFG_ST_RESOLUTION is set to 16 on 32-bit machine.
Adding casts fixes the problem. Checked with GCC, I don't know if other compilers have typeof.

return (bool)((typeof(systime_t))(curr - start) < (typeof(systime_t))(end - start));

Discussion

  • Giovanni Di Sirio

    Hi,

    Typeof is a GCC extension, we cannot use it in the portable code. Wouldn't a normal cast suffice there?

    Giovanni

     

    Last edit: Giovanni Di Sirio 2015-10-10
  • lb

    lb - 2015-10-10

    Well then we can use just (systime_t) cast.

     
  • Giovanni Di Sirio

    • summary: Problem with chVTIsTimeWithinX --> Problem with chVTIsTimeWithinX()
    • assigned_to: Giovanni Di Sirio
    • Affected Version: Trunk --> 3.0.2
    • Severity: Low --> Medium
    • Milestone: trunk --> 3.0.3
    • Fixed in Repository: False --> True
     
  • Giovanni Di Sirio

    • status: open --> closed
     

Log in to post a comment.