[U-Boot-Users] [PATCH 01/17] example/82559_eeprom: Fix multiple warnings and errors

Wolfgang Denk wd at denx.de
Mon May 19 00:21:17 CEST 2008


In message <1211130599-28289-2-git-send-email-plagnioj at 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




More information about the U-Boot mailing list