commit b40da22357563bf53fa93823342f8ab59899222d

Denys Vlasenko vda.linux at googlemail.com
Sat Jan 22 16:32:22 UTC 2011


On Saturday 22 January 2011 11:46, Cristian Ionescu-Idbohrn wrote:
> This move of the 3 typedefs:
> 
> diff --git a/include/platform.h b/include/platform.h
> index 6328ff6..cbde7bc 100644
> --- a/include/platform.h
> +++ b/include/platform.h
> @@ -218,14 +218,15 @@
> 
>  /* ---- Unaligned access ------------------------------------ */
> 
> +typedef int      bb__aliased_int      FIX_ALIASING;
> +typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
> +typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
> +
>  /* NB: unaligned parameter should be a pointer, aligned one -
>   * a lvalue. This makes it more likely to not swap them by mistake
>   */
>  #if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
>  # include <stdint.h>
> -typedef int      bb__aliased_int      FIX_ALIASING;
> -typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
> -typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
>  # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
>  # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
>  # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
> 
> 
> led to breakage:
> 
>   HOSTCC  applets/applet_tables
> In file included from applets/../include/libbb.h:13,
>                  from applets/../include/busybox.h:10,
>                  from applets/applet_tables.c:16:
> applets/../include/platform.h:222: error: expected '=', ',', ';', 'asm' or
> '__attribute__' before 'bb__aliased_uint16_t'
> applets/../include/platform.h:223: error: expected '=', ',', ';', 'asm' or
> '__attribute__' before 'bb__aliased_uint32_t'
> make[1]: *** [applets/applet_tables] Error 1
> make: *** [applets_dir] Error 2
> 
> 
> Back to normal with this patch:
> 
> diff --git a/include/platform.h b/include/platform.h
> index cbde7bc..bbbc0a9 100644
> --- a/include/platform.h
> +++ b/include/platform.h
> @@ -218,6 +218,7 @@
> 
>  /* ---- Unaligned access ------------------------------------ */
> 
> +#include <stdint.h>
>  typedef int      bb__aliased_int      FIX_ALIASING;
>  typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
>  typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
> @@ -226,7 +227,6 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
>   * a lvalue. This makes it more likely to not swap them by mistake
>   */
>  #if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
> -# include <stdint.h>
>  # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
>  # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
>  # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))


Fixed, thanks!
-- 
vda


More information about the busybox mailing list