25845f
commit b1aff6a41120c1d9cedc1ecedeafc79f161ce982
25845f
Author: Joseph Myers <joseph@codesourcery.com>
25845f
Date:   Tue Dec 2 22:03:59 2014 +0000
25845f
25845f
    Fix warning in posix/tst-getopt_long1.c.
25845f
    
25845f
    This patch fixes a "discards qualifiers" warning in
25845f
    posix/tst-getopt_long1.c.  glibc is built with -Wwrite-strings,
25845f
    meaning a char * cannot be initialized directly with a string
25845f
    constant; the patch casts the string constants to char *.
25845f
    
25845f
    Tested for x86_64.
25845f
    
25845f
            * posix/tst-getopt_long1.c (do_test): Cast elements of argv array
25845f
            to char *.
25845f
25845f
diff --git a/posix/tst-getopt_long1.c b/posix/tst-getopt_long1.c
25845f
index e0ecd121908de5f8..3895ebd99b291917 100644
25845f
--- a/posix/tst-getopt_long1.c
25845f
+++ b/posix/tst-getopt_long1.c
25845f
@@ -39,7 +39,7 @@ do_test (void)
25845f
       return 1;
25845f
     }
25845f
 
25845f
-  char *argv[] = { "program", "--on" };
25845f
+  char *argv[] = { (char *) "program", (char *) "--on" };
25845f
   int argc = 2;
25845f
 
25845f
   int c = getopt_long (argc, argv, "12345", opts, NULL);