AVR C Runtime Library - Bugs: bug #34278, Seemingly overzealous...
You are not allowed to post comments on this tracker with your current authentication level.
bug #34278: Seemingly overzealous "__builtin_avr_delay_cycles expects an integer constant"
Submitter: | Yann Dirson <ydirson> | ||
Submitted: | Mon 12 Sep 2011 09:55:32 PM UTC | ||
Category: | Header | Severity: | 3 - Normal |
Priority: | 5 - Normal | Item Group: | Header files |
Status: | Invalid | Assigned to: | joerg_wunsch |
Percent Complete: | 0% | Open/Closed: | Closed |
Release: | 1.7.1 | Fixed Release: | None |
Wed 14 Sep 2011 07:52:14 AM UTC, comment #2: |
Joerg Wunsch <joerg_wunsch> |
Tue 13 Sep 2011 08:04:36 AM UTC, comment #1: The strange thing is I cannot reproduce that at all.
|
Joerg Wunsch <joerg_wunsch> |
Mon 12 Sep 2011 09:55:32 PM UTC, original submission:
The problem occurs while compiling examples/atmel_key/ in simulavr (master from git), on a Debian testing amd64 host:
|
Yann Dirson <ydirson> |
Depends on the following items: None found
Items that depend on this one: None found
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2011-09-14 | joerg_wunsch | Status | Need Info | Invalid | |
Assigned to | None | joerg_wunsch | |||
Open/Closed | Open | Closed | |||
2011-09-13 | ydirson | Attached File | - | Added stddefs.tgz, #23972 | |
2011-09-13 | joerg_wunsch | Status | None | Need Info |
Powered by Savane 3.13-02a9.
Corresponding source code
Thanks for the archive, now I finally see the problem. Sorry
for being blind in the first place.
The compiler is correct. The code is:
Thus, _delay_ms() is called with "ms" which is a function
parameter. This is not supported (and has never been, but
with the current implementation, you finally get an error
while the code simply didn't do what it was expected to
do before).
A correct (with respect to what the comment above the
function says) implementation would look like:
In addition (and unlike the original comment), optimization
must be turned on for any of the _delay_us/ms functions
to work correctly.