Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp712283ybm; Fri, 29 May 2020 10:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD13gKHuhM6VsaEMQ5OalpY/2htOXMNVPFLtHxGTnaoI2IbpowQxaIwxjCVck0gOyyrzq7 X-Received: by 2002:a17:906:8402:: with SMTP id n2mr8321352ejx.26.1590772705211; Fri, 29 May 2020 10:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590772705; cv=none; d=google.com; s=arc-20160816; b=i9+QCGeVbH6kKIgRFIZq8fyxsjCX5lo/qfoSjd1I9E6d69kKgSbDZKI3rPFcA4G4QN jL3d/EvGXidQaJbgqk0Q206NUynyTRmFbzc/ZvHEFg86sAlRoyIYsx7AvTXSULvNBfrB MMJ/P0ethYXtkF9Yhw9Cg/NlFdWrkF1BC9y81CBSRqii+GFNKUnSA1rye7KSmqgz8mW+ QFuzc+YyMzqbFTwWq8CtrhPcJQznvLMuKJWbRYzG5+8kHGZi4K5F65cSmbfSkSIA3EkU DFA4cbrfy8K4NYZhqt7eaiAj8Gt1XyzJy5STttY5wQ9Ms28GU6+LAMUYmdN3IvrkgZTw 9Ulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EoxGlIPe1LsjlwkQynEP6dZut7A8ScGB3oV7Uy1EI1A=; b=BkFcxyj2VDTKKsvh+iynw/4SH54OnNi7niwq/SAQFIYed27F5eCG4dE/4HhbcMHqOn lelfoD8StjXUWSQMj+ULbMtA2opKKFoTvygQS8Z303i93RqqLbrEn7kHVyQNwLAtPSTe Xr6x6+ug9CMbhITgx8my0O0hHpAhMTX+x/odFgySPU17q3Hrf+lyWk4v2n6Clv9rDPce Cl/kzNMfatGaQNAg9vmeXel2r6rE9N7VVD2ZqCY+7NPyg3IpkykkUYxb3lxVqOwgiNjL ekGdy9JDrbGWTr6s2yUTJcgbFkRuewHeXGFepbyDDltVPn330DNqirpz/BeRoApgngsz QnUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cZK1s2V/"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si5717019edj.16.2020.05.29.10.17.53; Fri, 29 May 2020 10:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cZK1s2V/"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgE2RRE (ORCPT + 99 others); Fri, 29 May 2020 13:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbgE2RRE (ORCPT ); Fri, 29 May 2020 13:17:04 -0400 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61C9BC03E969 for ; Fri, 29 May 2020 10:17:04 -0700 (PDT) Received: by mail-oo1-xc42.google.com with SMTP id u190so39106ooa.10 for ; Fri, 29 May 2020 10:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EoxGlIPe1LsjlwkQynEP6dZut7A8ScGB3oV7Uy1EI1A=; b=cZK1s2V/IRqH4KIxoV1eJn93hhfrFxztPiHFTbqc6SA34p2eDFaKbaRD1kNJSLDauK rdv5DokTxG9ND3gG4oZZh48+Cp9tZVgdCLP4jL0kmkMiJ/vYiesnGEhSrsVvImQH5urq kTOJiscIgS70+eOE6nKjG1PDMKtBhp3h1Jgkc43lIncZU3cZnqpceBJ1/Qre27v+pO8J bpZyXrreibRE5tyKp6RmuRRNTWvK52wYkBu1nYjKoBVFoStJH0eJF/l70t3FXi5yG8zb hmbfnuFEbNdRI0D91gq+SBcpvlqmErzSvNKVUZJSUe7XHeW06XNqVodGmOaGV+4GmKyi jdwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EoxGlIPe1LsjlwkQynEP6dZut7A8ScGB3oV7Uy1EI1A=; b=KN+pvpUnZDbJ0QiNSAu+FLSFIOVQE0e6eMzcEudWDnkMUiKqaPEnA6YWKFeqzMH8p8 Y+NlLPhd9DyLO7ggjj21pwoP9UujbkfZcMDNEFe6QADS5vohGnWISbwTmZnkRAAir1TS eqL/GVFP/ijF6Ei2fbYh2Znq3cUPGOn5LEitSRsrs2q0Umf7qGqpQnG4b/gl9hfrk5wS rllnsfDzPaB3Hi3ISosuLn7qXstotcPfVxqCfgeeaqxPlQH9WUpQ+7cr63MzODgnzGfQ yJNGdhMDu3kwaQiTteAmpmZdBwlZuL/pblSzTRLf5eaeXqoM5QHAaKqO7Q1hisMQOf/Q kv0A== X-Gm-Message-State: AOAM533CbnmyjbjVSXXUTBqTUp60G5N7N/0pSPGtO2+N81TTtNw2w5hL sYpf5DnIqbiQZKAasJx/dRP8G4+Mj+7UeT8m3jM= X-Received: by 2002:a4a:e795:: with SMTP id x21mr7231858oov.91.1590772618938; Fri, 29 May 2020 10:16:58 -0700 (PDT) MIME-Version: 1.0 References: <20200529153814.213125-1-alainm@chromium.org> <20200529153814.213125-5-alainm@chromium.org> In-Reply-To: <20200529153814.213125-5-alainm@chromium.org> From: Luiz Augusto von Dentz Date: Fri, 29 May 2020 10:16:46 -0700 Message-ID: Subject: Re: [BlueZ PATCH v3 4/4] fixing const decoration warnins on options. To: Alain Michaud Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, On Fri, May 29, 2020 at 8:41 AM Alain Michaud wrote: > > This changes fixes const decoration warnins on options. What us this fixing? > --- > > Changes in v3: None > Changes in v2: None > > src/main.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/main.c b/src/main.c > index ca27f313d..cea50a3d2 100644 > --- a/src/main.c > +++ b/src/main.c > @@ -80,7 +80,7 @@ static enum { > MPS_MULTIPLE, > } mps = MPS_OFF; > > -static const char *supported_options[] = { > +static const char * const supported_options[] = { > "Name", > "Class", > "DiscoverableTimeout", > @@ -129,7 +129,7 @@ static const char * const controller_options[] = { > NULL > }; > > -static const char *policy_options[] = { > +static const char * const policy_options[] = { > "ReconnectUUIDs", > "ReconnectAttempts", > "ReconnectIntervals", > @@ -137,7 +137,7 @@ static const char *policy_options[] = { > NULL > }; > > -static const char *gatt_options[] = { > +static const char * const gatt_options[] = { > "Cache", > "KeySize", > "ExchangeMTU", > @@ -146,8 +146,8 @@ static const char *gatt_options[] = { > }; > > static const struct group_table { > - const char *name; > - const char **options; > + const char * const name; > + const char * const * const options; > } valid_groups[] = { > { "General", supported_options }, > { "Controller", controller_options }, > @@ -243,7 +243,7 @@ static enum jw_repairing_t parse_jw_repairing(const char *jw_repairing) > > > static void check_options(GKeyFile *config, const char *group, > - const char **options) > + const char * const * const options) > { > char **keys; > int i; > -- > 2.27.0.rc0.183.gde8f92d652-goog > I wonder how usufull is to tell it is a constant pointer to a constant character given that is so rarely in the kernel and userspace, something like const char * const * const would be very hard to keep it readable. -- Luiz Augusto von Dentz