Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error
@ 2026-08-14  5:10 David Marlin
  2026-08-14  5:46 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: David Marlin @ 2026-08-14  5:10 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz
  Cc: Gustavo A . R . Silva, David Marlin, Bastien Nocera

A recent build attempt, using gcc-14.4 on RHEL-10, produced the
following errors:

In file included from ./include/net/bluetooth/hci_core.h:35,
                 from net/bluetooth/hci_core.c:39:
./include/net/bluetooth/hci.h:1476:34: error: declaration does not
declare anything [-Werror]
  1476 |         struct hci_std_codecs_hdr;
       |                                  ^
./include/net/bluetooth/hci.h:1477:17: error: flexible array member in a
struct with no named members
  1477 |         __u8    codec[];
       |                 ^~~~~

./include/net/bluetooth/hci.h:1516:37: error: declaration does not
declare anything [-Werror]
  1516 |         struct hci_std_codecs_v2_hdr;
       |                                     ^
./include/net/bluetooth/hci.h:1517:33: error: flexible array member in a
struct with no named members
  1517 |         struct hci_std_codec_v2 codec[];
       |                                 ^~~~~

cc1: all warnings being treated as errors

Adding a variable name (e.g., 'num') to each of the above struct definitions
avoids the error without changing the layout of the struct.

Fixes: a0cff16d0f6e ("Bluetooth: hci.h: Avoid a couple -Wflex-array-member-not-at-end warnings")

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: David Marlin <dmarlin@redhat.com>
---
 include/net/bluetooth/hci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1641d879dbda..5ccc4545e380 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1472,7 +1472,7 @@ struct hci_std_codecs_hdr {
 } __packed;
 
 struct hci_std_codecs {
-	struct hci_std_codecs_hdr;
+	struct hci_std_codecs_hdr num;
 	__u8	codec[];
 } __packed;
 
@@ -1512,7 +1512,7 @@ struct hci_std_codecs_v2_hdr {
 } __packed;
 
 struct hci_std_codecs_v2 {
-	struct hci_std_codecs_v2_hdr;
+	struct hci_std_codecs_v2_hdr num;
 	struct hci_std_codec_v2 codec[];
 } __packed;
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-14  5:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  5:10 [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error David Marlin
2026-08-14  5:46 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox