/* Forward declaration */
extern const struct language_defn unknown_language_defn;
+extern char *warning_pre_print;
/* The current (default at startup) state of type and range checking.
(If the modes are set to "auto", though, these are changed based
/* FIXME -- do this from the list, with HELP. */
if (!language || !language[0]) {
- printf("The currently understood settings are:\n\n\
+ printf_filtered ("The currently understood settings are:\n\n\
local or auto Automatic setting based on source file\n\
c Use the C language\n\
c++ Use the C++ language\n\
int from_tty;
{
if (type_check != current_language->la_type_check)
- printf(
+ printf_filtered(
"Warning: the current type check setting does not match the language.\n");
}
{
if (range_check != current_language->la_range_check)
- printf(
+ printf_filtered(
"Warning: the current range check setting does not match the language.\n");
}
int quietly;
{
/* FIXME: quietly is ignored at the moment. */
- printf("Current Language: %s\n",language);
+ printf_filtered("Current Language: %s\n",language);
show_language_command((char *)0, 1);
- printf("Type checking: %s\n",type);
+ printf_filtered("Type checking: %s\n",type);
show_type_command((char *)0, 1);
- printf("Range checking: %s\n",range);
+ printf_filtered("Range checking: %s\n",range);
show_range_command((char *)0, 1);
}
\f
return (TYPE_CODE(type) == TYPE_CODE_INT) &&
TYPE_LENGTH(type) == sizeof(char)
? 1 : 0;
+ default:
+ return (0);
}
- return (0);
}
/* Returns non-zero if the value is a boolean type */
case language_c:
case language_cplus:
return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
+ default:
+ return (0);
}
- return (0);
}
/* Returns non-zero if the value is a floating-point type */
return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
(TYPE_CODE(type) == TYPE_CODE_SET) ||
(TYPE_CODE(type) == TYPE_CODE_ARRAY);
+ default:
+ return (0);
}
- return (0);
}
\f
/* This page contains functions that return info about
if ((numeric_type(t1) && pointer_type(t2)) ||
(pointer_type(t1) && numeric_type(t2)))
{
- printf("warning: combining pointer and integer.\n");
+ warning ("combining pointer and integer.\n");
break;
}
case BINOP_MUL:
else if ((pointer_type(t1) && integral_type(t2)) ||
(integral_type(t1) && pointer_type(t2)))
{
- printf("warning: combining integer and pointer.\n");
+ warning ("combining integer and pointer.\n");
break;
}
else if (!simple_type(t1) || !simple_type(t2))
type_op_error ("A pointer can only be assigned an integer.",op);
else if (pointer_type(t1) && integral_type(t2))
{
- printf("warning: combining integer and pointer.");
+ warning ("combining integer and pointer.");
break;
}
else if (!simple_type(t1) || !simple_type(t2))
case UNOP_IND:
if (integral_type(t1))
{
- printf("warning: combining pointer and integer.\n");
+ warning ("combining pointer and integer.\n");
break;
}
else if (!pointer_type(t1))
error (fmt,op_string(op));
else
{
- printf("warning: ");
- printf(fmt,op_string(op));
- printf("\n");
+ warning (fmt,op_string(op));
}
}
the rest of the arguments should be its arguments. If
[type|range]_check is [type|range]_check_on, then return_to_top_level()
is called in the style of error (). Otherwise, the message is prefixed
- by "warning: " and we do not return to the top level. */
+ by the value of warning_pre_print and we do not return to the top level. */
void
type_error (va_alist)
char *string;
if (type_check==type_check_warn)
- fprintf(stderr,"warning: ");
+ fprintf_filtered(stderr,warning_pre_print);
else
target_terminal_ours();
va_start (args);
string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
+ vfprintf_filtered (stderr, string, args);
+ fprintf_filtered (stderr, "\n");
va_end (args);
if (type_check==type_check_on)
return_to_top_level();
char *string;
if (range_check==range_check_warn)
- fprintf(stderr,"warning: ");
+ fprintf_filtered(stderr,warning_pre_print);
else
target_terminal_ours();
va_start (args);
string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
+ vfprintf_filtered (stderr, string, args);
+ fprintf_filtered (stderr, "\n");
va_end (args);
if (range_check==range_check_on)
return_to_top_level();
return "Unknown";
}
-struct cmd_list_element *setchecklist = NULL;
-struct cmd_list_element *showchecklist = NULL;
-
static void
set_check (ignore, from_tty)
char *ignore;
int from_tty;
{
- printf(
+ printf_filtered(
"\"set check\" must be followed by the name of a check subcommand.\n");
help_list(setchecklist, "set check ", -1, stdout);
}
static void
-show_check (arg, from_tty)
- char *arg;
+show_check (ignore, from_tty)
+ char *ignore;
int from_tty;
{
cmd_show_list(showchecklist, from_tty, "");
{
if (lang->la_magic != LANG_MAGIC)
{
- fprintf(stderr, "Magic number of %s language struct wrong\n",
+ fprintf_filtered(stderr, "Magic number of %s language struct wrong\n",
lang->la_name);
abort();
}