From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: "Insight (GDB GUI)" Subject: host_name and target_name Date: Fri, 03 Sep 1999 03:25:00 -0000 Message-id: <37CFA1EC.E424E2BD@cygnus.com> X-SW-Source: 1999-q3/msg00120.html 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 * 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);