From: Wolfgang Denk Date: Mon, 19 May 2008 00:21:17 +0200 Subject: [U-Boot-Users] [PATCH 01/17] example/82559_eeprom: Fix multiple warnings and errors In-Reply-To: Your message of "Sun, 18 May 2008 19:09:43 +0200." <1211130599-28289-2-git-send-email-plagnioj@jcrosoft.com> Message-ID: <20080518222117.D36D3248A8@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1211130599-28289-2-git-send-email-plagnioj@jcrosoft.com> you wrote: > include/image.h: In function 'image_set_name': > include/image.h:374: warning: implicit declaration of function 'strncpy' > 82559_eeprom.c: In function 'memcpy': > 82559_eeprom.c:57: error: lvalue required as increment operand > 82559_eeprom.c:57: error: lvalue required as increment operand > 82559_eeprom.c: In function 'main': > 82559_eeprom.c:318: warning: pointer targets in passing argument 2 of 'gethwaddr' differ in signedness ... > -#define _PPC_STRING_H_ /* avoid unnecessary str/mem functions */ > -#define _LINUX_STRING_H_ /* avoid unnecessary str/mem functions */ > +#define __HAVE_ARCH_MEMCPY 1 /* avoid unnecessary memcpy function */ > +#define _PPC_STRING_H_ 1 /* avoid unnecessary str/mem functions */ Why these changes? > -static inline void *memcpy(void *dst, const void *src, unsigned int len) > +inline void *memcpy(void *dst, const void *src, unsigned int len) If we define __HAVE_ARCH_MEMCPY, should we not delete the whole memcpy() part then? > --- a/include/asm-i386/string.h > +++ b/include/asm-i386/string.h > @@ -5,6 +5,8 @@ > * We don't do inline string functions, since the > * optimised inline asm versions are not small. > */ > +#undef __HAVE_ARCH_STRNCPY > +extern char *strncpy(char *dest, const char *src, size_t count); > > #undef __HAVE_ARCH_STRRCHR This makes no sense to me. If the implementation has strrchr(), I bet a case of beer it will also have strncpy(). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There are three things I always forget. Names, faces - the third I can't remember. - Italo Svevo