From: David Marlin <dmarlin@redhat.com>
To: linux-bluetooth@vger.kernel.org,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "Gustavo A . R . Silva" <gustavoars@kernel.org>,
David Marlin <dmarlin@redhat.com>,
Bastien Nocera <hadess@hadess.net>
Subject: [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error
Date: Fri, 14 Aug 2026 00:10:12 -0500 [thread overview]
Message-ID: <20260814051032.261320-1-dmarlin@redhat.com> (raw)
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
next reply other threads:[~2026-08-14 5:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 5:10 David Marlin [this message]
2026-08-14 5:46 ` Bluetooth: hci-core: fix "declaration does not declare anything" error bluez.test.bot
2026-08-21 2:08 ` [PATCH] " kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260814051032.261320-1-dmarlin@redhat.com \
--to=dmarlin@redhat.com \
--cc=gustavoars@kernel.org \
--cc=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.