This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Get rid of duplicate const declaration specifier warning in tst-resolv-qtypes.c.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: Stefan Liebler <stli at linux dot vnet dot ibm dot com>, GNU C Library <libc-alpha at sourceware dot org>, Libc-stable Mailing List <libc-stable at sourceware dot org>
- Date: Thu, 7 Sep 2017 13:05:21 -0700
- Subject: Re: Get rid of duplicate const declaration specifier warning in tst-resolv-qtypes.c.
- Authentication-results: sourceware.org; auth=none
- References: <8d30c0c3-0b00-fc08-8e49-811aec114ef9@linux.vnet.ibm.com> <878tpry1ce.fsf@linux-m68k.org> <4c0d8778-916b-43d4-3206-2653f3696390@linux.vnet.ibm.com> <20170224095709.GA4243@altlinux.org> <CAMe9rOqmd0sDjrNCoHeguu+qT5h2CwBB9VvK9wOuJu7EBqPH=A@mail.gmail.com> <956dda0f-fd50-f940-f69b-5f22b7237215@cs.ucla.edu> <CAMe9rOphx7XWqCBT3N72JywsGHbvz+UZNACMnPu2Tjsg_F8=fQ@mail.gmail.com> <dfa3dac6-d8fd-22fc-ee45-9be0654c0e28@cs.ucla.edu>
On Thu, Sep 7, 2017 at 12:51 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> H.J. Lu wrote:
>>>
>>> Why not:
>>>
>>> static const char domain[] = "www.example.com";
>>>
>>> instead, before you backport? It's simpler and less confusing.
>
>
>> If we want to do this, it should go into master branch first and
>> backport it 2.26 branch before putting in 2.25 branch. Should
>> we do it?
>
>
> Yes, that's the idea.
Here is the patch. Tested with GCC 7 on x86-64.
OK for master and 2.25/2.26 branches?
Thanks.
--
H.J.
From cb99c41d24dbba967974ac6ed3d1a23dc7f66cfd Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 7 Sep 2017 13:02:36 -0700
Subject: [PATCH] Use "static const char domain[] ="
* resolv/tst-resolv-qtypes.c (domain): Changed to
"const char domain[] =".
---
resolv/tst-resolv-qtypes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c
index 06ea3dbd14..da3325f80c 100644
--- a/resolv/tst-resolv-qtypes.c
+++ b/resolv/tst-resolv-qtypes.c
@@ -50,7 +50,7 @@ response (const struct resolv_response_context *ctx,
resolv_response_close_record (b);
}
-static const char * const domain = "www.example.com";
+static const char domain[] = "www.example.com";
static int
wrap_res_query (int type, unsigned char *answer, int answer_length)
--
2.13.5