Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 134b2f45 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh Committed by Zach Johnson
Browse files

Work around clang/llvm compilation problems.

These patches will allow us to compile the whole AOSP with clang/llvm
before all the following problems are fixed.
* Suppress warnings on unused variables.
  * Remove unused static variables.
* Use only gcc to compile code that requires gcc atomic functions.
  They should be converted to standard atomic functions later.
* Suppress warnings on redefined typedefs.

BUG: 20765701
Change-Id: I19bc0a256c19502fabcabd1ca158637a8b5741a2
parent a4dc5bf8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# osi/include/atomic.h depends on gcc atomic functions
LOCAL_CLANG := false

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/../osi/include \
@@ -45,6 +48,9 @@ include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

# osi/include/atomic.h depends on gcc atomic functions
LOCAL_CLANG := false

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/..
+0 −1
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ extern module_t counter_module;
}  // "C"

static const uint64_t COUNTER_TEST_TEN = 10;
static const uint64_t COUNTER_TEST_ZERO = 0;

typedef struct mycounter_t {
  const char *name;
+1 −4
Original line number Diff line number Diff line
@@ -60,10 +60,7 @@ static const char *command_sample_data = "that thou art not used to this busines
static const char *ignored_data = "and if thou art afraid, away with thee out of this and betake thyself to prayer";
static const char *unignored_data = "while I engage them in fierce and unequal combat";

static const char *logging_path = "this/is/a/test/logging/path";

static const hci_t *hci;
static bdaddr_t test_addr = (bdaddr_t)"testaddress123";
static const hci_hal_callbacks_t *hal_callbacks;
static thread_t *internal_thread;
static vendor_cb firmware_config_callback;
@@ -367,7 +364,7 @@ STUB_FUNCTION(void, low_power_transmit_done, ())

STUB_FUNCTION(bool, vendor_open, (UNUSED_ATTR const uint8_t *addr, const hci_t *hci_interface))
  DURING(start_up_async) AT_CALL(0) {
    //EXPECT_EQ(test_addr, addr); // TODO(zachoverflow): reinstate when address put into module
    // TODO(zachoverflow): check address value when it gets put into a module
    EXPECT_EQ(hci, hci_interface);
    return true;
  }
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# osi/include/atomic.h depends on gcc atomic functions
LOCAL_CLANG := false

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/..
@@ -45,6 +48,8 @@ LOCAL_SRC_FILES := \
    ./src/thread.c

LOCAL_CFLAGS := -std=c99 -Wall -Werror
# Many .h files have redefined typedefs
LOCAL_CLANG_CFLAGS += -Wno-error=typedef-redefinition
LOCAL_MODULE := libosi
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libc liblog
@@ -56,6 +61,9 @@ include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

# osi/include/atomic.h depends on gcc atomic functions
LOCAL_CLANG := false

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/..
+1 −2
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ bool gatt_server_build() {
  TASSERT(gatt_get_status() == BT_STATUS_SUCCESS, "Error adding characteristics.");

  // Adds descriptor.
  int char_handle = gatt_get_characteristic_handle();
  CALL_AND_WAIT(gatt_interface->server->add_descriptor(server_if, srvc_handle, &desc_uuid, 0x01), btgatts_descriptor_added_cb);
  TASSERT(gatt_get_status() == BT_STATUS_SUCCESS, "Error adding descriptor.");

Loading