diff mbox

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

Message ID CAMe9rOqVEHZWPFSJ0ZYR3ifsrABWx_tPe1ELOoG+VoSi+6M0jw@mail.gmail.com
State New, archived
Headers show

Commit Message

H.J. Lu Sept. 7, 2017, 8:05 p.m. UTC
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.

Comments

Paul Eggert Sept. 7, 2017, 8:51 p.m. UTC | #1
H.J. Lu wrote:
> OK for master and 2.25/2.26 branches?

Thanks, it looks good.
diff mbox

Patch

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