Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3933

PATCH Qt applications fail to build on ARM using g++ -Werror -Wold-style-cast

    XMLWordPrintable

Details

    • c63fe6fcfc83028419dd84d13d24e7cb1295ac7f

    Description

      Attempted to build an application on ARM using g++ -Werror -Wold-style-cast.

      Expected to see:
      Successful compile without errors

      Got instead:
      Compile failed due to C-style pointer casts in Qt headers specific to the ARM architecture

      More details:
      This patch resolves the problem:

      diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h
      index fe8e7a1..645fbee 100644
      — a/src/corelib/arch/qatomic_arm.h
      +++ b/src/corelib/arch/qatomic_arm.h
      @@ -108,8 +108,8 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
      // kernel places a restartable cmpxchg implementation at a fixed address
      extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr);
      extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval, volatile void *ptr);
      -#define qt_atomic_eabi_cmpxchg_int (*(qt_atomic_eabi_cmpxchg_int_t *)0xffff0fc0)
      -#define qt_atomic_eabi_cmpxchg_ptr (*(qt_atomic_eabi_cmpxchg_ptr_t *)0xffff0fc0)
      +#define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast<qt_atomic_eabi_cmpxchg_int_t *>(0xffff0fc0))
      +#define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast<qt_atomic_eabi_cmpxchg_ptr_t *>(0xffff0fc0))

      #else

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes