[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bugs #11494] strtol() return wrong value in the underflo

From: Eric Weddington
Subject: [avr-libc-dev] [bugs #11494] strtol() return wrong value in the underflow case
Date: Wed, 05 Jan 2005 12:04:40 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1

This mail is an automated notification from the bugs tracker
 of the project: AVR C Runtime Library.

[bugs #11494] Latest Modifications:

Changes by: 
                Eric Weddington <address@hidden>
                Wed 01/05/2005 at 16:50 (America/Denver)

            What     | Removed                   | Added
            Priority | 5 - Normal                | 7 - High

[bugs #11494] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=11494>
Project: AVR C Runtime Library
Submitted by: 0
On: Wed 01/05/2005 at 07:31

Category:  Library
Severity:  5 - Average
Priority:  7 - High
Item Group:  None
Resolution:  None
Privacy:  Public
Percent Complete:  0%
Assigned to:  None
Originator Email:  address@hidden
Status:  Open

Summary:  strtol() return wrong value in the underflow case

Original Submission:  This is very old bug.
strtol() must return LONG_MIN for inputs too small.
Original Berkeley version do it.  But avr-libc's version, for example, 
"-5000000000" --> -705032704 (simulavr, avr-gcc 3.3.4). You can reproduce such 
result on any 32-bit computer.

The reason is the attemption to negative LONG_MIN value (0x80000000).
Attached patch correct this mistake. (And it excude compiler warnings in 

File Attachments

Date: Wed 01/05/2005 at 07:31  Name: strtol-20050105.diff  Size: 856B   By: None
Patch for strtol.c (from avr-libc-1.2.0)

For detailed info, follow this link:

  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]