This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] -Wwrite-strings: Some constification in gdb/breakpoint.c
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 05 Apr 2017 21:50:28 -0400
- Subject: [binutils-gdb] -Wwrite-strings: Some constification in gdb/breakpoint.c
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 63160a43508fb50d9013df061b2191de71f67b50 ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 63160a43508fb50d9013df061b2191de71f67b50
-Wwrite-strings: Some constification in gdb/breakpoint.c
The main motivation here is avoiding having to write a couple casts
like these:
if (!arg)
- arg = "";
+ arg = (char *) "";
in catch_exception_command_1 and catch_exec_command_1.
That requires making ep_parse_optional_if_clause and
check_for_argument take pointers to const strings. I then tried
propagating the resulting constification all the way, but that was
spiraling out of control, so instead I settled for keeping const and
non-const overloads.
gdb/ChangeLog:
2017-04-05 Pedro Alves <palves@redhat.com>
* break-catch-throw.c (handle_gnu_v3_exceptions): Constify
'cond_string' parameter.
(extract_exception_regexp): Constify 'string' parameter.
(catch_exception_command_1): Constify.
* breakpoint.c (init_catchpoint)
(create_fork_vfork_event_catchpoint): Constify 'cond_string'
parameter.
(ep_parse_optional_if_clause, catch_fork_command_1)
(catch_exec_command_1): Constify.
* breakpoint.h (init_catchpoint): Constify 'cond_string'
parameter.
(ep_parse_optional_if_clause): Constify.
* cli/cli-utils.c (remove_trailing_whitespace)
(check_for_argument): Constify.
* cli/cli-utils.h (remove_trailing_whitespace): Constify and add
non-const overload.
(check_for_argument): Likewise.