* host_name and target_name
@ 1999-09-03 3:25 Andrew Cagney
0 siblings, 0 replies; only message in thread
From: Andrew Cagney @ 1999-09-03 3:25 UTC (permalink / raw)
To: Insight (GDB GUI)
Hello,
I recently changed the type of ``host_name'' and ``target_name'' to
(const char *) since they are not modified. Unfortunatly, Tcl_SetVar2()
expects a non-const value parameter even though it does treat it as
const/read-only.
The patch below casts those parameters. Perhaphs this should be
converted into a bug-report for the TCL group.
Andrew
Fri Sep 3 20:16:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbtk.c (gdbtk_init): Cast ``host_name'' and ``target_name'' to
void. While Tcl_SetVar2 treats the value argument as read-only
its prototype does not specify const for the parameter.
Index: gdbtk.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk.c,v
retrieving revision 2.141
diff -p -r2.141 gdbtk.c
*** gdbtk.c 1999/09/03 10:15:31 2.141
--- gdbtk.c 1999/09/03 10:20:37
*************** gdbtk_init (argv0)
*** 403,410 ****
for start up options and the like */
sprintf (s, "%d", inhibit_gdbinit);
Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "inhibit_prefs", s, TCL_GLOBAL_ONLY);
! Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "host_name", host_name, TCL_GLOBAL_ONLY);
! Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "target_name", target_name, TCL_GLOBAL_ONLY);
make_final_cleanup (gdbtk_cleanup, NULL);
--- 403,413 ----
for start up options and the like */
sprintf (s, "%d", inhibit_gdbinit);
Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "inhibit_prefs", s, TCL_GLOBAL_ONLY);
! /* Note: Tcl_SetVar2() treats the value as read-only (making a
! copy). Unfortunatly it does not mark the parameter as
! ``const''. */
! Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "host_name", (char*) host_name, TCL_GLOBAL_ONLY);
! Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "target_name", (char*) target_name, TCL_GLOBAL_ONLY);
make_final_cleanup (gdbtk_cleanup, NULL);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-09-03 3:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-03 3:25 host_name and target_name Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).