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

 
 

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

Submitted by:  P. Skroob <skroob>
Submitted on:  Tue 16 Mar 2010 03:12:07 PM UTC  
 
Category: HeaderSeverity: 3 - Normal
Priority: 9 - ImmediateItem Group: Header files
Status: FixedPercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: 1.6.8Fixed Release: 1.6.1

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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

Fixed in trunk revision 2201.

Eric Weddington <arcanum>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project 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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by arcanum (Posted a comment)
  • -unavailable- added by skroob (Submitted the item)
  •  

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

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 16 Dec 2010 11:05:22 PM UTCarcanumStatusNone=>Fixed
      Percent Complete0%=>100%
      Assigned toNone=>arcanum
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>1.6.1
    Tue 16 Mar 2010 04:32:38 PM UTCarcanumPriority5 - Normal=>9 - Immediate
    Tue 16 Mar 2010 03:12:07 PM UTCskroobAttached File-=>Added power.h.diff, #19959

    Back to the top


    Powered by Savane 3.1-cleanup1