URL:
<http://savannah.nongnu.org/bugs/?34278>
Summary: Seemingly overzealous "__builtin_avr_delay_cycles
expects an integer constant"
Project: AVR C Runtime Library
Submitted by: ydirson
Submitted on: lun. 12 sept. 2011 23:55:32 CEST
Category: Header
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Header files
Status: None
Percent Complete: 0%
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: 1.7.1
Fixed Release: None
_______________________________________________________
Details:
The problem occurs while compiling examples/atmel_key/ in simulavr (master
from git), on a Debian testing amd64 host:
make[2]: Entering directory `/work/yann/elec/avr/simulavr/examples/atmel_key'
avr-gcc -mmcu=atmega128 -I. -Os -funsigned-char -funsigned-bitfields
-fpack-struct -fshort-enums -Wall -Wstrict-prototypes -c -o StdDefs.o
StdDefs.c
StdDefs.c: In function ‘putstr’:
StdDefs.c:122:4: warning: pointer targets in passing argument 1 of
‘strlen’ differ in signedness
/usr/lib/gcc/avr/4.5.3/../../../avr/include/string.h:133:15: note: expected
‘const char *’ but argument is of type ‘CHARU *’
In file included from StdDefs.c:8:0:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h: In function
‘msleep’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:153:28: error:
__builtin_avr_delay_cycles expects an integer constant.
make[2]: *** [StdDefs.o] Error 1
The _delay_ms() cpp expansion looks correct, though - seems strange at first
sight:
# 132 "/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h" 3
void
_delay_ms(double __ms)
{
uint16_t __ticks;
double __tmp ;
uint32_t __ticks_dc;
extern void __builtin_avr_delay_cycles(unsigned long);
__tmp = ((4000000UL) / 1e3) * __ms;
# 150 "/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h" 3
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?34278>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
_______________________________________________
AVR-libc-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev