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

Message ID 8d30c0c3-0b00-fc08-8e49-811aec114ef9@linux.vnet.ibm.com
State Superseded
Headers

Commit Message

Stefan Liebler Jan. 31, 2017, 7:39 a.m. UTC
  Hi,

Compiling resolv/tst-resolv-qtypes.c with GCC 7 results in:
tst-resolv-qtypes.c:53:14: error: duplicate ‘const’ declaration 
specifier [-Werror=duplicate-decl-specifier]
  static const const char *domain = "www.example.com";

This patch removes one of the two const specifiers.

Ok to commit (after release)?

Bye.
Stefan

ChangeLog:

	* resolv/tst-resolv-qtypes.c (domain):
	Remove duplicate const qualifier.
  

Comments

Andreas Schwab Jan. 31, 2017, 10:23 a.m. UTC | #1
On Jan 31 2017, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:

>  static const const char *domain = "www.example.com";

domain should be const.

Andreas.
  

Patch

commit 8967a533335bff0feaa2abae242de94c928c9214
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Mon Jan 30 09:06:44 2017 +0100

    Get rid of duplicate const declaration specifier warning in tst-resolv-qtypes.c.
    
    Compiling resolv/tst-resolv-qtypes.c with GCC 7 results in:
    tst-resolv-qtypes.c:53:14: error: duplicate ‘const’ declaration specifier [-Werror=duplicate-decl-specifier]
     static const const char *domain = "www.example.com";
    
    This patch removes one of the two const specifiers.
    
    ChangeLog:
    
    	* resolv/tst-resolv-qtypes.c (domain):
    	Remove duplicate const qualifier.

diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c
index dcb39e5..2d91e92 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 const char *domain = "www.example.com";
+static const char *domain = "www.example.com";
 
 static int
 wrap_res_query (int type, unsigned char *answer, int answer_length)