bugAVR C Runtime Library - Bugs: bug #29235, power.h - warning: comma at end of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29235: power.h - warning: comma at end of enumerator list

Submitter:  P. Skroob <skroob>
Submitted:  Tue 16 Mar 2010 03:12:07 PM UTC
   
 
Category:  Header Severity:  3 - Normal
Priority:  9 - Immediate Item Group:  Header files
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.8 Fixed Release:  1.6.1

Thu 16 Dec 2010 11:05:22 PM UTC, comment #5: 

Fixed in trunk revision 2201.

Eric Weddington <arcanum>
Group administrator
Sun 04 Apr 2010 11:15:02 AM UTC, comment #4: 

IMHO it doesn't matter if _all_ of avr-libc would pass the checks. from a user perspective it only matters if the headers pass the checks.

btw extensions can be used by the double-underscore extension name:
s/inline/__inline__/
s/asm/__asm__/

example:
make -s "CFLAGS=-pedantic -std=c89 -Dinline=__inline__ -Dasm=__asm__"



Hose Bag <user>
Mon 29 Mar 2010 05:45:51 PM UTC, comment #3: 

Hmm. After reviewing the GCC manual about -pedantic here:
<http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Warning-Options.html#Warning-Options>

It says this:
"Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the version of the ISO C standard specified by any -std option used."

First, I don't know if all of avr-libc would pass the pedantic check anyway because we use extensions, which is not strict ISO C. Second, it makes sure it follows the version of the ISO C standard specified by any -std option used. I would recommend that we put in the documentation that avr-libc tries to follow the C99 standard, and NOT anything earlier.

Based on this, I would recommend making the doc change discussed above, so it is clear that we do not recommend using -pedantic and that we code against the C99 standard, and closing this bug as invalid.

Thoughts?

Eric Weddington <arcanum>
Group administrator
Tue 16 Mar 2010 09:58:07 PM UTC, comment #2: 

Minor remark:

I'm dual-minded about that.  Formally not allowing a comma at the end
of an enumeration has been an accidental syntactical mistake in the
original C standard, and C99 got away with that mistake by changing
the rules in a way so the trailing comma is explicitly allowed.  Thus,
the code as it is now is fully compliant with the applicable standard.

I see the possible discrepancy though as it is part of a library that
ought to be "as compatible as possible" even with historical standards
that are no longer in effect.  Anyway, I'd encourage everybody to
finally move their projects (and compiler options) to C99, more than
10 years after that standard got in effect.  Folks, please do it
before C1x is going to replace C99. ;-)

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 16 Mar 2010 04:32:38 PM UTC, comment #1: 

Thanks for the patch! We'll get this fixed shortly.

Eric Weddington <arcanum>
Group administrator
Tue 16 Mar 2010 03:12:07 PM UTC, original submission:  

when power.h is compiled with gcc's -pedantic, a warning is issued because the comma at the end of an enumerator list of enum clock_div_t.

I'm attaching a patch against current CVS. please commit.

thanks in advance!

tobias

P. Skroob <skroob>

 

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

Attached Files
file #19959:  power.h.diff added by skroob (353B - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by arcanum (Posted a comment)
  • -email is unavailable- added by skroob (Submitted the item)
  •  

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-16 arcanum StatusNone Fixed
        Percent Complete0% 100%
        Assigned toNone arcanum
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.6.1
    2010-03-16 arcanum Priority5 - Normal 9 - Immediate
    2010-03-16 skroob Attached File- Added power.h.diff, #19959

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code