avr-libc-dev
[Top][All Lists]
Advanced

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

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


From: Paul Schlie
Subject: Re: [avr-libc-dev] [bugs #11494] strtol() return wrong value in the underflow case
Date: Mon, 10 Jan 2005 18:39:02 -0500
User-agent: Microsoft-Entourage/11.1.0.040913

Aren't __LONG_MIN__ __LONG_MAX__ defined intrinsically by GCC?

 (if asm files included as necessary a file passed through GCC invoked
  with -mint or not, to pickup the defs, that might work as desired?)

> From: Eric Weddington <address@hidden>
> Date: Mon, 10 Jan 2005 22:51:37 +0000
> To: Eric Weddington <address@hidden>, <address@hidden>
> Subject: [avr-libc-dev] [bugs #11494] strtol() return wrong value in the
> underflow case
> 
> 
> This is an automated notification sent by Savannah.
> It relates to:
> bugs #11494, project AVR C Runtime Library
> 
> ==============================================================================
>  LATEST MODIFICATIONS of bugs #11494:
> ==============================================================================
> 
>                Posted by: Eric Weddington <arcanum>
>                Posted on: 2005-01-10 22:51 (America/Denver)
>     _______________________________________________________
> 
> Follow-up Comment:
> In the patch for this bug, can you rewrite your typecasts using the types
> found in stdint.h? (for example uint32_t, uint16_t)
> 
> 
> 
> That way it can start to be -mint8 compatible.
> 
> 
> 
> Thanks!
> 
> Eric
> 
> ==============================================================================
>  OVERVIEW of bugs #11494:
> ==============================================================================
> 
> URL:
>   <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=11494>
> 
>                  Summary: strtol() return wrong value in the underflow case
>                  Project: AVR C Runtime Library
>             Submitted by: None
>             Submitted on: Wed 01/05/2005 at 07:31
>                 Category: Library
>                 Severity: 5 - Average
>                 Priority: 9 - Immediate
>               Item Group: None
>                   Status: None
>                  Privacy: Public
>         Percent Complete: 0%
>              Assigned to: None
>         Originator Email: address@hidden
>              Open/Closed: Open
> 
>     _______________________________________________________
> 
> 
> 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
> comparison).
> 
>     _______________________________________________________
> 
> Follow-up Comments:
> 
> 
> -------------------------------------------------------
> Date: Mon 01/10/2005 at 22:51       By: Eric Weddington <arcanum>
> In the patch for this bug, can you rewrite your typecasts using the types
> found in stdint.h? (for example uint32_t, uint16_t)
> 
> 
> 
> That way it can start to be -mint8 compatible.
> 
> 
> 
> Thanks!
> 
> Eric
> 
> -------------------------------------------------------
> Date: Thu 01/06/2005 at 07:29       By: Anonymous
> Look, please, the optimized strtol, patch #3618. Twice speed up, and 32 bytes
> stack usage decrease. Code size the same.
> 
> 
> 
> 
> 
> 
> 
>     _______________________________________________________
> 
> 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)
> <http://savannah.nongnu.org/bugs/download.php?item_id=11494&item_file_id=2025>
> 
> ==============================================================================
> 
> This item URL is:
>   <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=11494>
> 
> _______________________________________________
>   Message sent via/by Savannah
>   http://savannah.nongnu.org/
> 
> 
> 
> _______________________________________________
> AVR-libc-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-libc-dev






reply via email to

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