This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Get rid of duplicate const declaration specifier warning in tst-resolv-qtypes.c.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]