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