bugAVR C Runtime Library - Bugs: bug #46303, eu_dst() in include/util/eu_dst.h...

 
 

bug #46303: eu_dst() in include/util/eu_dst.h returns wrong DST info (avr-libc 1.8.1)

Submitted by:  Fred <fredavr>
Submitted on:  Mon 26 Oct 2015 11:03:16 PM UTC  
 
Category: HeaderSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Header files
Status: FixedPercent Complete: 100%
Assigned to: Mike Rice <swfltek>Open/Closed: Closed
Release: 1.8.0Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 27 Oct 2015 08:10:22 PM UTC, comment #1:

I think the bug is not fixed. eu_dst() tells me that DST does not apply on 2015-10-24 01:00:00 UTC. But it should.

From eu_dst() :

/* determine mday of last Sunday */
n = tmptr.tm_mday - 1;
n -= day_of_week;
n += 7;
d = n % 7; /* date of first Sunday */

n = 31 - d;
n /= 7; /* number of Sundays left in the month */

d = d + 7 * n; /* mday of final Sunday */

If we try with tmptr.tm_mday == 25 and day_of_week == 0 (for October 25th, which is the last Sunday of October in 2015), then we get d == 31. Which is actually the last Saturday of October.

Fred <fredavr>
Mon 26 Oct 2015 11:03:16 PM UTC, original submission:

Inside eu_dst(), 1 is subtracted from tmptr.tm_mday, which seems to give wrong DST info. See the attached patch.

Fred <fredavr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #35310:  eu_dst.h.patch added by fredavr (819B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by swfltek (Updated the item)
  • -unavailable- added by fredavr (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Oct 2015 09:09:03 AM UTCswfltekStatusNone=>Fixed
      Percent Complete0%=>100%
      Assigned toNone=>swfltek
      Open/ClosedOpen=>Closed
    Mon 26 Oct 2015 11:03:16 PM UTCfredavrAttached File-=>Added eu_dst.h.patch, #35310

    Back to the top


    Powered by Savane 3.1-cleanup1