Improve release doc slightly.
[deliverable/binutils-gdb.git] / gdb / language.c
index d96b3b51ea704079d66c61e3f57d2538d7beba09..32ed779cd7e3b20d3c51ab117955b74b13bfc1b2 100644 (file)
@@ -85,6 +85,7 @@ set_type_range PARAMS ((void));
 
 /* 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
@@ -155,7 +156,7 @@ set_language_command (ignore, from_tty)
 
   /* 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\
@@ -203,7 +204,7 @@ show_type_command(ignore, from_tty)
    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");
 }
 
@@ -249,7 +250,7 @@ show_range_command(ignore, from_tty)
 {
 
    if (range_check != current_language->la_range_check)
-      printf(
+      printf_filtered(
 "Warning: the current range check setting does not match the language.\n");
 }
 
@@ -398,11 +399,11 @@ language_info (quietly)
      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
@@ -624,8 +625,9 @@ character_type (type)
       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 */
@@ -641,8 +643,9 @@ boolean_type (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 */
@@ -678,8 +681,9 @@ structured_type(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
@@ -755,7 +759,7 @@ binop_type_check(arg1,arg2,op)
       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:
@@ -780,7 +784,7 @@ binop_type_check(arg1,arg2,op)
       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))
@@ -809,7 +813,7 @@ binop_type_check(arg1,arg2,op)
         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))
@@ -834,7 +838,7 @@ binop_type_check(arg1,arg2,op)
    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))
@@ -906,9 +910,7 @@ op_error (fmt,op,fatal)
       error (fmt,op_string(op));
    else
    {
-      printf("warning:  ");
-      printf(fmt,op_string(op));
-      printf("\n");
+      warning (fmt,op_string(op));
    }
 }
 
@@ -917,7 +919,7 @@ op_error (fmt,op,fatal)
    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)
@@ -927,14 +929,14 @@ 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();
@@ -948,14 +950,14 @@ range_error (va_alist)
    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();
@@ -979,22 +981,19 @@ language_str(lang)
   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, "");
@@ -1008,7 +1007,7 @@ add_language (lang)
 {
   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();
     }
This page took 0.026203 seconds and 4 git commands to generate.