[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #34278] Seemingly overzealous "__builtin_avr_delay_c

From: Yann Dirson
Subject: [avr-libc-dev] [bug #34278] Seemingly overzealous "__builtin_avr_delay_cycles expects an integer constant"
Date: Mon, 12 Sep 2011 21:55:33 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110816 Iceweasel/3.6.20 (like Firefox/3.6.20)


                 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



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: 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
/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

# 132 "/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h" 3
_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:


  Message posté via/par Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]