pkgsrc/emulators/simulavr/patches/patch-examples_atmel_key_StdDefs_c
mef 611e027d22 (pkgsrc)
simulavr asks for libiberty.a.
  With avr-gcc 4.5.3 and avr-binutils-2.23.2, binutils is installing
  libiberty.a
  But with new binutils-2.24, it won't install libiberty. Instead,
  avr-gcc-4.8.3 will provied libiberty.
  Makefile (of simulavr) now has pointer to PATH of libiberty now
  as:
    CONFIGURE_ARGS+=        --with-libiberty=${PREFIX}/lib/gcc/avr
(Add patches)
   patch-src_systemclock_cpp (rename from  patch-src_systemclock.cpp)
   patch-src_systemclock_h
   patch-src_traceval_cpp
   patch-src_traceval_h
     clang flags as resize unresolved reference,
     backport from git repository (as of 2013-09-15).
  patch-examples_atmel_key_StdDefs_c        Status: Locally Added
     passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
2014-08-29 04:40:06 +00:00

40 lines
1.4 KiB
Text

$NetBSD: patch-examples_atmel_key_StdDefs_c,v 1.1 2014/08/29 04:40:06 mef Exp $
StdDefs.c: In function 'putstr':
StdDefs.c:120:4: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
for (j = 0; j <= strlen(s); j++)
^
In file included from StdDefs.c:10:0:
/usr/pkg/avr/include/string.h:133:15: note: expected 'const char *' but argument is of type 'CHARU *'
extern size_t strlen(const char *) __ATTR_PURE__;
--- /export/WRKOBJDIR/wip/simulavr/work/simulavr-1.0.0/examples/atmel_key/StdDefs.c 2014-06-20 23:24:10.000000000 +0900
+++ ./examples/atmel_key/StdDefs.c 2014-06-20 12:31:14.000000000 +0900
@@ -55,13 +55,11 @@
}
// Delay in 1/10's of a millisecond
-void msleep(INT16U ms)
- { /* This loop does not work with optimization != 0. Therefore we use
- avr-libc _delay routines K. Schwichtenberg
- INT16S i,j;
- for (i = 1; i < ms; i++)
- for (j = 1; j < ONETENTH_MS; j++); / * to give 1/10 ms*/
- _delay_ms(ms); // Changed K. Schwichtenberg
+// Does not work with -O0, use -O1, even for debugging.
+void msleep(INT16U ms10)
+ {
+ for( ; ms10; --ms10)
+ _delay_ms(0.1);
}
//------------------------------------------------------------
@@ -117,7 +115,7 @@
void putstr(CHARU *s)
{
int j;
- for (j = 0; j <= strlen(s); j++)
+ for (j = 0; j <= strlen((char*)s); j++)
putchar(*(s + j));
CRLF();
}