summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hsin-chen Chuang <chharry@google.com> 2024-08-23 11:45:28 +0800
committer Hsin-chen Chuang <chharry@google.com> 2024-08-23 13:34:41 +0800
commite31b4169c1f6bb12f480134213822d96a460c662 (patch)
tree393e0295e8cb5de0fe6588aa3c95bd08bc26e916
parent2098b15ec2b642b69f93b59298f765c72e7c7a09 (diff)
floss: Fix build faliure: non-void function does not return a value
Also enabled Werror in build.py and fixed a warning in bt_service. Bug: 290844854 Bug: 361684591 Tag: #floss Test: mmm packages/modules/Bluetooth Test: USE=floss_upstream emerge-nami floss Flag: EXEMPT, Floss-only changes Change-Id: If832a37a4bd466b0862ca0c4773919b80239fb2f
-rwxr-xr-xbuild.py2
-rw-r--r--system/btif/src/bluetooth.cc2
-rw-r--r--system/gd/rust/linux/service/src/main.rs2
-rw-r--r--system/include/hardware/bluetooth.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/build.py b/build.py
index ff41424431..1f2a925351 100755
--- a/build.py
+++ b/build.py
@@ -380,7 +380,7 @@ class HostBuild():
'enable_exceptions': os.environ.get('CXXEXCEPTIONS', 0) == '1',
'external_cflags': [],
'external_cxxflags': ["-DNDEBUG"],
- 'enable_werror': False,
+ 'enable_werror': True,
}
if clang:
diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc
index 6a9a5728b6..d46d594591 100644
--- a/system/btif/src/bluetooth.cc
+++ b/system/btif/src/bluetooth.cc
@@ -432,7 +432,7 @@ static bool is_profile(const char* p1, const char* p2) {
#ifdef TARGET_FLOSS
static int global_hci_adapter = 0;
-static int set_adapter_index(int adapter) { global_hci_adapter = adapter; }
+static void set_adapter_index(int adapter) { global_hci_adapter = adapter; }
int GetAdapterIndex() { return global_hci_adapter; }
#else
int GetAdapterIndex() { return 0; } // Unsupported outside of FLOSS
diff --git a/system/gd/rust/linux/service/src/main.rs b/system/gd/rust/linux/service/src/main.rs
index e9700c6bb2..17a0fa1f3b 100644
--- a/system/gd/rust/linux/service/src/main.rs
+++ b/system/gd/rust/linux/service/src/main.rs
@@ -99,7 +99,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let hci_index = matches.value_of("hci").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0));
// The remaining flags are passed down to Fluoride as is.
- let mut init_flags: Vec<String> = match matches.values_of("init-flags") {
+ let init_flags: Vec<String> = match matches.values_of("init-flags") {
Some(args) => args.map(String::from).collect(),
None => vec![],
};
diff --git a/system/include/hardware/bluetooth.h b/system/include/hardware/bluetooth.h
index faf67a4bbf..5d7de41006 100644
--- a/system/include/hardware/bluetooth.h
+++ b/system/include/hardware/bluetooth.h
@@ -665,7 +665,7 @@ typedef struct {
size_t size;
#ifdef TARGET_FLOSS
/** set index of the adapter to use */
- int (*set_adapter_index)(int adapter_index);
+ void (*set_adapter_index)(int adapter_index);
#endif
/**