Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix warning in posix/tst-getopt_long1.c.
This patch fixes a "discards qualifiers" warning in
posix/tst-getopt_long1.c.  glibc is built with -Wwrite-strings,
meaning a char * cannot be initialized directly with a string
constant; the patch casts the string constants to char *.

Tested for x86_64.

	* posix/tst-getopt_long1.c (do_test): Cast elements of argv array
	to char *.
  • Loading branch information
Joseph Myers committed Dec 2, 2014
1 parent 266865c commit b1aff6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
2014-12-02 Joseph Myers <joseph@codesourcery.com>

* posix/tst-getopt_long1.c (do_test): Cast elements of argv array
to char *.

[BZ #17665]
* posix/unistd.h [__USE_MISC || (__USE_XOPEN && !__USE_UNIX98)]:
Change conditional to [__USE_MISC].
Expand Down
2 changes: 1 addition & 1 deletion posix/tst-getopt_long1.c
Expand Up @@ -39,7 +39,7 @@ do_test (void)
return 1;
}

char *argv[] = { "program", "--on" };
char *argv[] = { (char *) "program", (char *) "--on" };
int argc = 2;

int c = getopt_long (argc, argv, "12345", opts, NULL);
Expand Down

0 comments on commit b1aff6a

Please sign in to comment.