[Top][All Lists]

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

[bug #57114] Do not #define abs / labs

From: Georg-Johann Lay
Subject: [bug #57114] Do not #define abs / labs
Date: Fri, 25 Oct 2019 04:42:02 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0


                 Summary: Do not #define abs / labs
                 Project: AVR C Runtime Library
            Submitted by: gjlayde
            Submitted on: Fri 25 Oct 2019 08:42:00 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
        Percent Complete: 0%
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 2.0.0
           Fixed Release: None



#define'ing abs is evil, in particular together with C++ when there are
methods called abs or there is abs polymorphism.

Same for labs.

The patch provides proper functions (kind of) without introducing overhead.

        * include/stdlib.h (__ATTR_ALWAYS_INLINE__): New macro.
        (abs): Provide in such a way that we get a prototype.
        (labs): Same.


File Attachments:

Date: Fri 25 Oct 2019 08:42:00 AM UTC  Name: stdlib-abs.diff  Size: 1KiB   By:



Reply to this item at:


  Message sent via Savannah

reply via email to

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