cobjective-cxcodearm

EXC_BAD_ACCESS pointing me an arm line of code


I´m trying to know what I´m doing wrong because the console is giving me an EXC_BAD_ACCESS, just in the arm line I´m pointing below. Any pointing to the solution could help, because I don´t understand why is giving me this error.

Thanks.

 /*
 * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
 */

#ifndef _OS_OSBYTEORDERARM_H
#define _OS_OSBYTEORDERARM_H

#include <stdint.h>
#include <arm/arch.h> /* for _ARM_ARCH_6 */

 #if !defined(OS_INLINE)
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#        define OS_INLINE static inline
# else
 #        define OS_INLINE static __inline__
# endif
#endif

 * Generic byte swapping functions. */

OS_INLINE
uint16_t
 _OSSwapInt16(
  uint16_t        data
  )
 {
  #if defined(__llvm__)
 data = (data << 8 | data >> 8);
#elif defined(_ARM_ARCH_6)
  __asm__ ("rev16 %0, %1\n" : "=l" (data) : "l" (data));   <- This is the line pointed by the compiler

Solution

  • You wrote:

    <- This is the line pointed by the compiler

    Therewith you say that the EXC_BAD_ACCESS occurs during compilation. If a compiler throwed such an exception during its work, it would dump it and get me a better one.