Index: gdb/ChangeLog 2005-12-19 Alexandre Oliva * c-exp.y (parse_number): Silence type-punning warnings. * jv-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * tui/tui-data.c (source_windows): Likewise. * varobj.c (free_variable): Likewise. Index: gdb/c-exp.y =================================================================== --- gdb/c-exp.y.orig 2005-12-19 15:07:39.000000000 -0200 +++ gdb/c-exp.y 2005-12-19 15:25:35.000000000 -0200 @@ -1082,9 +1082,9 @@ p[len] = 0; /* null-terminate the token */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - num = sscanf (p, "%g%s", (float *) &putithere->typed_val_float.dval,s); + num = sscanf (p, "%g%s", (float *) (void *) &putithere->typed_val_float.dval,s); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - num = sscanf (p, "%lg%s", (double *) &putithere->typed_val_float.dval,s); + num = sscanf (p, "%lg%s", (double *) (void *) &putithere->typed_val_float.dval,s); else { #ifdef SCANF_HAS_LONG_DOUBLE Index: gdb/jv-exp.y =================================================================== --- gdb/jv-exp.y.orig 2005-12-19 15:07:41.000000000 -0200 +++ gdb/jv-exp.y 2005-12-19 15:24:53.000000000 -0200 @@ -714,9 +714,9 @@ p[len] = 0; /* null-terminate the token */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval, &c); + num = sscanf (p, "%g%c", (float *) (void *) &putithere->typed_val_float.dval, &c); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval, &c); + num = sscanf (p, "%lg%c", (double *) (void *) &putithere->typed_val_float.dval, &c); else { #ifdef SCANF_HAS_LONG_DOUBLE Index: gdb/objc-exp.y =================================================================== --- gdb/objc-exp.y.orig 2005-12-19 15:07:45.000000000 -0200 +++ gdb/objc-exp.y 2005-12-19 15:24:53.000000000 -0200 @@ -1026,9 +1026,9 @@ /* It's a float since it contains a point or an exponent. */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - sscanf (p, "%g", (float *)&putithere->typed_val_float.dval); + sscanf (p, "%g", (float *) (void *) &putithere->typed_val_float.dval); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval); + sscanf (p, "%lg", (double *) (void *) &putithere->typed_val_float.dval); else { #ifdef PRINTF_HAS_LONG_DOUBLE Index: gdb/p-exp.y =================================================================== --- gdb/p-exp.y.orig 2005-12-19 15:07:45.000000000 -0200 +++ gdb/p-exp.y 2005-12-19 15:24:53.000000000 -0200 @@ -800,9 +800,9 @@ p[len] = 0; /* null-terminate the token */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c); + num = sscanf (p, "%g%c", (float *) (void *) &putithere->typed_val_float.dval,&c); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c); + num = sscanf (p, "%lg%c", (double *) (void *) &putithere->typed_val_float.dval,&c); else { #ifdef SCANF_HAS_LONG_DOUBLE Index: gdb/tui/tui-data.c =================================================================== --- gdb/tui/tui-data.c.orig 2005-12-19 15:07:52.000000000 -0200 +++ gdb/tui/tui-data.c 2005-12-19 15:24:53.000000000 -0200 @@ -44,7 +44,13 @@ static struct tui_gen_win_info _locator; static struct tui_gen_win_info exec_info[2]; static struct tui_win_info * src_win_list[2]; -static struct tui_list source_windows = {(void **) src_win_list, 0}; +/* The intermediate cast to void* silences a type-punning warning + issued by GCC. The use appears to be safe, since we always access + source_windows.list with type void**, and whenever we access one of + the list members, we cast it to struct tui_win_info*. The + interface of struct tui_list should probably be redesigned with + less type opacity to avoid type punning. -aoliva */ +static struct tui_list source_windows = {(void **) (void *) src_win_list, 0}; static int default_tab_len = DEFAULT_TAB_LEN; static struct tui_win_info * win_with_focus = (struct tui_win_info *) NULL; static struct tui_layout_def layout_def = Index: gdb/varobj.c =================================================================== --- gdb/varobj.c.orig 2005-12-19 15:07:50.000000000 -0200 +++ gdb/varobj.c 2005-12-19 15:24:53.000000000 -0200 @@ -1374,7 +1374,7 @@ /* Free the expression if this is a root variable. */ if (var->root->rootvar == var) { - free_current_contents ((char **) &var->root->exp); + free_current_contents (&var->root->exp); xfree (var->root); }