diff mbox series

[1/2] wpa_cli: Fix duplicate const warning

Message ID 1515383840-7921-1-git-send-email-masashi.honma@gmail.com
State Superseded
Headers show
Series [1/2] wpa_cli: Fix duplicate const warning | expand

Commit Message

Masashi Honma Jan. 8, 2018, 3:57 a.m. UTC
wpa_cli.c:1541:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
 static const char const *cred_fields[] = {
                   ^~~~~

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
 wpa_supplicant/wpa_cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masashi Honma Feb. 4, 2018, 1:49 a.m. UTC | #1
On 2018/02/03 19:19, Jouni Malinen wrote:
> That's wrong..
> 
>> diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
>> -static const char const *cred_fields[] = {
>> +static const char *cred_fields[] = {
> 
> But this is not the fix.. I'd assume this was supposed to be an array of
> const-pointer to const-char, so I'll replace this with 'const char *
> const' instead.

The cred_fields looks be used by only one function. So how about making it local
variable and using the name "fields" ? Just like wpa_cli_complete_get_capability().

Masashi Honma.
diff mbox series

Patch

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 7d2d6ac..3d5ac18 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1538,7 +1538,7 @@  static int wpa_cli_cmd_remove_cred(struct wpa_ctrl *ctrl, int argc,
 }
 
 
-static const char const *cred_fields[] = {
+static const char *cred_fields[] = {
 	"temporary", "priority", "sp_priority", "pcsc", "eap",
 	"update_identifier", "min_dl_bandwidth_home", "min_ul_bandwidth_home",
 	"min_dl_bandwidth_roaming", "min_ul_bandwidth_roaming", "max_bss_load",