AVR C Runtime Library - Bugs: bug #32650, Missing include in util/delay.h
You are not allowed to post comments on this tracker with your current authentication level.
bug #32650: Missing include in util/delay.h
Submitter: | Alastair D'Silva <deece> | ||
Submitted: | Wed 02 Mar 2011 12:15:55 PM UTC | ||
Category: | Header | Severity: | 3 - Normal |
Priority: | 5 - Normal | Item Group: | libc code |
Status: | Fixed | Assigned to: | arcanum |
Percent Complete: | 100% | Open/Closed: | Closed |
Release: | 1.7.* | Fixed Release: | 1.7.2 |
Fri 04 Mar 2011 11:42:46 PM UTC, comment #3: |
Alastair D'Silva <deece> |
Fri 04 Mar 2011 04:17:04 PM UTC, comment #2: Is there any way that we can test to see if the parameter is not a constant and then issue an error if it is not a constant?
|
Eric Weddington <arcanum> |
Fri 04 Mar 2011 04:48:38 AM UTC, comment #1: The math library is not needed if you do not pass a variable to _delay_ms (or _delay_us) as the instructions to avr-libc warn you not to do. Only constants can be supplied to the delay functions.
|
Stu Bell <stusan_2> |
Wed 02 Mar 2011 12:15:55 PM UTC, original submission:
Compiling using gcc 4.5.2 against AVR LibC 1.7.1 results in calls to _delay_ms failing with:
|
Alastair D'Silva <deece> |
Depends on the following items: None found
Items that depend on this one: None found
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2011-05-12 | arcanum | Status | None | Fixed | |
Percent Complete | 0% | 100% | |||
Assigned to | None | arcanum | |||
Open/Closed | Open | Closed | |||
Fixed Release | None | 1.7.2 | |||
2011-03-04 | deece | Attached File | - | Added Testcase.cpp, #22840 |
Powered by Savane 3.13-758e.
Corresponding source code
Please note that this error occurs when the header is included, regardless of whether a constant or a variable is passed (in my case, it was actually a constant), even to the extent that if no calls are made to the delay functions, and the header is included, it fails.
The attached trivial testcase will produce the following error using GCC 4.5.2:
make all
Building file: ../Testcase.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"A:\eclipse\mhvlib" -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -funsigned-char -funsigned-bitfields -fno-exceptions -mmcu=atmega1280 -DF_CPU=16000000UL -MMD -MP -MF"Testcase.d" -MT"Testcase.d" -c -o"Testcase.o" "../Testcase.cpp"
In file included from ../Testcase.cpp:3:0:
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h: In function 'void _delay_ms(double)':
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h:149:42: error: 'fabs' was not declared in this scope
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h:149:43: error: 'ceil' was not declared in this scope
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h: In function 'void _delay_us(double)':
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h:226:42: error: 'fabs' was not declared in this scope
c:\mhvavrtools\bin\../lib/gcc/avr/4.5.2/../../../../avr/include/util/delay.h:226:43: error: 'ceil' was not declared in this scope
make: * [Testcase.o] Error 1
(file #22840)