keiths / rpms / gdb

Forked from rpms/gdb 4 days ago
Clone
Jan Kratochvil 979799f
http://sourceware.org/ml/gdb-cvs/2012-08/msg00133.html
Jan Kratochvil 979799f
Jan Kratochvil 979799f
### src/gdb/ChangeLog	2012/08/17 03:06:10	1.14599
Jan Kratochvil 979799f
### src/gdb/ChangeLog	2012/08/17 17:36:56	1.14600
Jan Kratochvil 979799f
## -1,3 +1,48 @@
Jan Kratochvil 979799f
+2012-08-17  Keith Seitz  <keiths@redhat.com>
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+	PR c++/13356
Jan Kratochvil 979799f
+	* gdbtypes.c (strict_type_checking): New variable.
Jan Kratochvil 979799f
+	(show_strict_type_checking): New function.
Jan Kratochvil 979799f
+	(rank_one_type): Return NS_POINTER_INTEGER_CONVERSION_BADNESS
Jan Kratochvil 979799f
+	if strict type checking is disabled.
Jan Kratochvil 979799f
+	(_initialize_gdbtypes): Add "check type" subcommand.
Jan Kratochvil 979799f
+	* gdbtypes.h (NS_INTEGER_POINTER_CONVERSION_BADNESS): New struct.
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+2012-08-17  Keith Seitz  <keiths@redhat.com>
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+	* language.h (type_mode): Remove.
Jan Kratochvil 979799f
+	(type_check): Remove.
Jan Kratochvil 979799f
+	(struct language_defn): Remove la_type_check.
Jan Kratochvil 979799f
+	(STRICT_TYPE): Remove unused macro.
Jan Kratochvil 979799f
+	(type_error): Remove.
Jan Kratochvil 979799f
+	* language.c (set_type_range_case): Renamed to ...
Jan Kratochvil 979799f
+	(set_range_case): ... this.  Update all callers.
Jan Kratochvil 979799f
+	Remove type_mode/type_check.
Jan Kratochvil 979799f
+	(type_mode): Remove.
Jan Kratochvil 979799f
+	(type_check): Remove.
Jan Kratochvil 979799f
+	(show_type_command): Remove.
Jan Kratochvil 979799f
+	(set_type_command): Remove.
Jan Kratochvil 979799f
+	(language_info): Remove type checking output.
Jan Kratochvil 979799f
+	(type_error): Remove unused function.
Jan Kratochvil 979799f
+	(range_error): Update comment.
Jan Kratochvil 979799f
+	(unknown_language_defn): Remove la_type_check.
Jan Kratochvil 979799f
+	(auto_language_defn): Likewise.
Jan Kratochvil 979799f
+	(local_language_defn): Likewise.
Jan Kratochvil 979799f
+	(_initialize_language): Remove "check type" subcommand.
Jan Kratochvil 979799f
+	* ada-lang.c (ada_language_defn): Remove la_type_check.
Jan Kratochvil 979799f
+	* c-lang.c (c_language_defn): Likewise.
Jan Kratochvil 979799f
+	(cplus_language_defn): Likewise.
Jan Kratochvil 979799f
+	(asm_language_defn): Likewise.
Jan Kratochvil 979799f
+	(minimal_language_defn): Likewise.
Jan Kratochvil 979799f
+	* d-lang.c (d_language_defn): Likewise.
Jan Kratochvil 979799f
+	* f-lang.c (f_language_defn): Likewise.
Jan Kratochvil 979799f
+	* go-lang.c (go_language_defn): Likewise.
Jan Kratochvil 979799f
+	* jv-lang.c (java_language_defn): Likewise.
Jan Kratochvil 979799f
+	* m2-lang.c (m2_language_defn): Likewise.
Jan Kratochvil 979799f
+	* objc-lang.c (objc_language_defn): Likewise.
Jan Kratochvil 979799f
+	* opencl-lang.c (opencl_language_defn): Likewise.
Jan Kratochvil 979799f
+	* p-lang.c (pascal_language_defn): Likewise.
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 2012-08-16  Mike Frysinger  <vapier@gentoo.org>
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 	* infcmd.c (_initialize_infcmd): Remove trailing ) in next help text.
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/gdbtypes.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/gdbtypes.c	2012-09-27 22:14:21.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/gdbtypes.c	2012-09-27 22:15:05.807706105 +0200
Jan Kratochvil 979799f
@@ -62,6 +62,7 @@ const struct rank BASE_CONVERSION_BADNES
Jan Kratochvil 979799f
 const struct rank REFERENCE_CONVERSION_BADNESS = {2,0};
Jan Kratochvil 979799f
 const struct rank NULL_POINTER_CONVERSION_BADNESS = {2,0};
Jan Kratochvil 979799f
 const struct rank NS_POINTER_CONVERSION_BADNESS = {10,0};
Jan Kratochvil 979799f
+const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS = {3,0};
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 /* Floatformat pairs.  */
Jan Kratochvil 979799f
 const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = {
Jan Kratochvil 979799f
@@ -134,6 +135,19 @@ show_overload_debug (struct ui_file *fil
Jan Kratochvil 979799f
 		    value);
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
+/* A flag to enable strict type checking.  */
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+static int strict_type_checking = 1;
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+/* A function to show the status of strict type checking.  */
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+static void
Jan Kratochvil 979799f
+show_strict_type_checking (struct ui_file *file, int from_tty,
Jan Kratochvil 979799f
+			   struct cmd_list_element *c, const char *value)
Jan Kratochvil 979799f
+{
Jan Kratochvil 979799f
+  fprintf_filtered (file, _("Strict type checking is %s.\n"), value);
Jan Kratochvil 979799f
+}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 struct extra
Jan Kratochvil 979799f
   {
Jan Kratochvil 979799f
     char str[128];
Jan Kratochvil 979799f
@@ -2649,12 +2663,20 @@ rank_one_type (struct type *parm, struct
Jan Kratochvil 979799f
 	case TYPE_CODE_FUNC:
Jan Kratochvil 979799f
 	  return rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL);
Jan Kratochvil 979799f
 	case TYPE_CODE_INT:
Jan Kratochvil 979799f
-	  if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT
Jan Kratochvil 979799f
-	      && value_as_long (value) == 0)
Jan Kratochvil 979799f
+	  if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT)
Jan Kratochvil 979799f
 	    {
Jan Kratochvil 979799f
-	      /* Null pointer conversion: allow it to be cast to a pointer.
Jan Kratochvil 979799f
-		 [4.10.1 of C++ standard draft n3290]  */
Jan Kratochvil 979799f
-	      return NULL_POINTER_CONVERSION_BADNESS;
Jan Kratochvil 979799f
+	      if (value_as_long (value) == 0)
Jan Kratochvil 979799f
+		{
Jan Kratochvil 979799f
+		  /* Null pointer conversion: allow it to be cast to a pointer.
Jan Kratochvil 979799f
+		     [4.10.1 of C++ standard draft n3290]  */
Jan Kratochvil 979799f
+		  return NULL_POINTER_CONVERSION_BADNESS;
Jan Kratochvil 979799f
+		}
Jan Kratochvil 979799f
+	      else
Jan Kratochvil 979799f
+		{
Jan Kratochvil 979799f
+		  /* If type checking is disabled, allow the conversion.  */
Jan Kratochvil 979799f
+		  if (!strict_type_checking)
Jan Kratochvil 979799f
+		    return NS_INTEGER_POINTER_CONVERSION_BADNESS;
Jan Kratochvil 979799f
+		}
Jan Kratochvil 979799f
 	    }
Jan Kratochvil 979799f
 	  /* fall through  */
Jan Kratochvil 979799f
 	case TYPE_CODE_ENUM:
Jan Kratochvil 979799f
@@ -4637,4 +4659,13 @@ _initialize_gdbtypes (void)
Jan Kratochvil 979799f
 			   NULL, NULL,
Jan Kratochvil 979799f
 			   show_opaque_type_resolution,
Jan Kratochvil 979799f
 			   &setlist, &showlist);
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+  /* Add an option to permit non-strict type checking.  */
Jan Kratochvil 979799f
+  add_setshow_boolean_cmd ("type", class_support,
Jan Kratochvil 979799f
+			   &strict_type_checking,
Jan Kratochvil 979799f
+			   _("Set strict type checking."),
Jan Kratochvil 979799f
+			   _("Show strict type checking."),
Jan Kratochvil 979799f
+			   NULL, NULL,
Jan Kratochvil 979799f
+			   show_strict_type_checking,
Jan Kratochvil 979799f
+			   &setchecklist, &showchecklist);
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/gdbtypes.h
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/gdbtypes.h	2012-09-27 22:14:23.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/gdbtypes.h	2012-09-27 22:14:40.690695059 +0200
Jan Kratochvil 979799f
@@ -1745,6 +1745,9 @@ extern const struct rank NULL_POINTER_CO
Jan Kratochvil 979799f
 /* Converting a pointer to an int is usually OK.  */
Jan Kratochvil 979799f
 extern const struct rank NS_POINTER_CONVERSION_BADNESS;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
+/* Badness of converting a (non-zero) integer constant
Jan Kratochvil 979799f
+   to a pointer.  */
Jan Kratochvil 979799f
+extern const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 extern struct rank sum_ranks (struct rank a, struct rank b);
Jan Kratochvil 979799f
 extern int compare_ranks (struct rank a, struct rank b);
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/language.h
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/language.h	2012-06-13 17:47:14.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/language.h	2012-09-27 22:14:40.834695121 +0200
Jan Kratochvil 979799f
@@ -55,27 +55,6 @@ extern enum range_check
Jan Kratochvil 979799f
   }
Jan Kratochvil 979799f
 range_check;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-/* type_mode ==
Jan Kratochvil 979799f
-   type_mode_auto:   type_check set automatically to default of language.
Jan Kratochvil 979799f
-   type_mode_manual: type_check set manually by user.  */
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-extern enum type_mode
Jan Kratochvil 979799f
-  {
Jan Kratochvil 979799f
-    type_mode_auto, type_mode_manual
Jan Kratochvil 979799f
-  }
Jan Kratochvil 979799f
-type_mode;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-/* type_check ==
Jan Kratochvil 979799f
-   type_check_on:    Types are checked in GDB expressions, producing errors.
Jan Kratochvil 979799f
-   type_check_warn:  Types are checked, producing warnings.
Jan Kratochvil 979799f
-   type_check_off:   Types are not checked in GDB expressions.  */
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-extern enum type_check
Jan Kratochvil 979799f
-  {
Jan Kratochvil 979799f
-    type_check_off, type_check_warn, type_check_on
Jan Kratochvil 979799f
-  }
Jan Kratochvil 979799f
-type_check;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 /* case_mode ==
Jan Kratochvil 979799f
    case_mode_auto:   case_sensitivity set upon selection of scope.
Jan Kratochvil 979799f
    case_mode_manual: case_sensitivity set only by user.  */
Jan Kratochvil 979799f
@@ -162,10 +141,6 @@ struct language_defn
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
     enum range_check la_range_check;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-    /* Default type checking.  */
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-    enum type_check la_type_check;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
     /* Default case sensitivity.  */
Jan Kratochvil 979799f
     enum case_sensitivity la_case_sensitivity;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
@@ -422,9 +397,6 @@ struct type *language_lookup_primitive_t
Jan Kratochvil 979799f
 /* These macros define the behaviour of the expression 
Jan Kratochvil 979799f
    evaluator.  */
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-/* Should we strictly type check expressions?  */
Jan Kratochvil 979799f
-#define STRICT_TYPE (type_check != type_check_off)
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 /* Should we range check values against the domain of their type?  */
Jan Kratochvil 979799f
 #define RANGE_CHECK (range_check != range_check_off)
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
@@ -496,8 +468,6 @@ extern void binop_type_check (struct val
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 /* Error messages */
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-extern void type_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 /* Data:  Does this value represent "truth" to the current language?  */
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/language.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/language.c	2012-03-02 20:29:01.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/language.c	2012-09-27 22:14:40.922695162 +0200
Jan Kratochvil 979799f
@@ -55,7 +55,7 @@ static void show_check (char *, int);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 static void set_check (char *, int);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-static void set_type_range_case (void);
Jan Kratochvil 979799f
+static void set_range_case (void);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 static void unk_lang_emit_char (int c, struct type *type,
Jan Kratochvil 979799f
 				struct ui_file *stream, int quoter);
Jan Kratochvil 979799f
@@ -81,8 +81,6 @@ extern const struct language_defn unknow
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 enum range_mode range_mode = range_mode_auto;
Jan Kratochvil 979799f
 enum range_check range_check = range_check_off;
Jan Kratochvil 979799f
-enum type_mode type_mode = type_mode_auto;
Jan Kratochvil 979799f
-enum type_check type_check = type_check_off;
Jan Kratochvil 979799f
 enum case_mode case_mode = case_mode_auto;
Jan Kratochvil 979799f
 enum case_sensitivity case_sensitivity = case_sensitive_on;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
@@ -174,7 +172,7 @@ set_language_command (char *ignore, int
Jan Kratochvil 979799f
 	      /* Enter manual mode.  Set the specified language.  */
Jan Kratochvil 979799f
 	      language_mode = language_mode_manual;
Jan Kratochvil 979799f
 	      current_language = languages[i];
Jan Kratochvil 979799f
-	      set_type_range_case ();
Jan Kratochvil 979799f
+	      set_range_case ();
Jan Kratochvil 979799f
 	      expected_language = current_language;
Jan Kratochvil 979799f
 	      return;
Jan Kratochvil 979799f
 	    }
Jan Kratochvil 979799f
@@ -186,79 +184,6 @@ set_language_command (char *ignore, int
Jan Kratochvil 979799f
 		  language);
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-/* Show command.  Display a warning if the type setting does
Jan Kratochvil 979799f
-   not match the current language.  */
Jan Kratochvil 979799f
-static void
Jan Kratochvil 979799f
-show_type_command (struct ui_file *file, int from_tty,
Jan Kratochvil 979799f
-		   struct cmd_list_element *c, const char *value)
Jan Kratochvil 979799f
-{
Jan Kratochvil 979799f
-  if (type_mode == type_mode_auto)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-      char *tmp = NULL;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-      switch (type_check)
Jan Kratochvil 979799f
-	{
Jan Kratochvil 979799f
-	case type_check_on:
Jan Kratochvil 979799f
-	  tmp = "on";
Jan Kratochvil 979799f
-	  break;
Jan Kratochvil 979799f
-	case type_check_off:
Jan Kratochvil 979799f
-	  tmp = "off";
Jan Kratochvil 979799f
-	  break;
Jan Kratochvil 979799f
-	case type_check_warn:
Jan Kratochvil 979799f
-	  tmp = "warn";
Jan Kratochvil 979799f
-	  break;
Jan Kratochvil 979799f
-	default:
Jan Kratochvil 979799f
-	  internal_error (__FILE__, __LINE__,
Jan Kratochvil 979799f
-			  "Unrecognized type check setting.");
Jan Kratochvil 979799f
-	}
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-      fprintf_filtered (gdb_stdout,
Jan Kratochvil 979799f
-			_("Type checking is \"auto; currently %s\".\n"),
Jan Kratochvil 979799f
-			tmp);
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  else
Jan Kratochvil 979799f
-    fprintf_filtered (gdb_stdout, _("Type checking is \"%s\".\n"),
Jan Kratochvil 979799f
-		      value);
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-   if (type_check != current_language->la_type_check)
Jan Kratochvil 979799f
-    warning (_("the current type check setting"
Jan Kratochvil 979799f
-	       " does not match the language.\n"));
Jan Kratochvil 979799f
-}
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-/* Set command.  Change the setting for type checking.  */
Jan Kratochvil 979799f
-static void
Jan Kratochvil 979799f
-set_type_command (char *ignore, int from_tty, struct cmd_list_element *c)
Jan Kratochvil 979799f
-{
Jan Kratochvil 979799f
-  if (strcmp (type, "on") == 0)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-      type_check = type_check_on;
Jan Kratochvil 979799f
-      type_mode = type_mode_manual;
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  else if (strcmp (type, "warn") == 0)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-      type_check = type_check_warn;
Jan Kratochvil 979799f
-      type_mode = type_mode_manual;
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  else if (strcmp (type, "off") == 0)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-      type_check = type_check_off;
Jan Kratochvil 979799f
-      type_mode = type_mode_manual;
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  else if (strcmp (type, "auto") == 0)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-      type_mode = type_mode_auto;
Jan Kratochvil 979799f
-      set_type_range_case ();
Jan Kratochvil 979799f
-      return;
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  else
Jan Kratochvil 979799f
-    internal_error (__FILE__, __LINE__,
Jan Kratochvil 979799f
-		    _("Unrecognized type check setting: \"%s\""), type);
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-  if (type_check != current_language->la_type_check)
Jan Kratochvil 979799f
-    warning (_("the current type check setting"
Jan Kratochvil 979799f
-	       " does not match the language.\n"));
Jan Kratochvil 979799f
-}
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 /* Show command.  Display a warning if the range setting does
Jan Kratochvil 979799f
    not match the current language.  */
Jan Kratochvil 979799f
 static void
Jan Kratochvil 979799f
@@ -320,7 +245,7 @@ set_range_command (char *ignore, int fro
Jan Kratochvil 979799f
   else if (strcmp (range, "auto") == 0)
Jan Kratochvil 979799f
     {
Jan Kratochvil 979799f
       range_mode = range_mode_auto;
Jan Kratochvil 979799f
-      set_type_range_case ();
Jan Kratochvil 979799f
+      set_range_case ();
Jan Kratochvil 979799f
       return;
Jan Kratochvil 979799f
     }
Jan Kratochvil 979799f
   else
Jan Kratochvil 979799f
@@ -389,7 +314,7 @@ set_case_command (char *ignore, int from
Jan Kratochvil 979799f
    else if (strcmp (case_sensitive, "auto") == 0)
Jan Kratochvil 979799f
      {
Jan Kratochvil 979799f
        case_mode = case_mode_auto;
Jan Kratochvil 979799f
-       set_type_range_case ();
Jan Kratochvil 979799f
+       set_range_case ();
Jan Kratochvil 979799f
        return;
Jan Kratochvil 979799f
      }
Jan Kratochvil 979799f
    else
Jan Kratochvil 979799f
@@ -409,14 +334,11 @@ set_case_command (char *ignore, int from
Jan Kratochvil 979799f
    If SHOW is non-zero, then print out the current language,
Jan Kratochvil 979799f
    type and range checking status.  */
Jan Kratochvil 979799f
 static void
Jan Kratochvil 979799f
-set_type_range_case (void)
Jan Kratochvil 979799f
+set_range_case (void)
Jan Kratochvil 979799f
 {
Jan Kratochvil 979799f
   if (range_mode == range_mode_auto)
Jan Kratochvil 979799f
     range_check = current_language->la_range_check;
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-  if (type_mode == type_mode_auto)
Jan Kratochvil 979799f
-    type_check = current_language->la_type_check;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
   if (case_mode == case_mode_auto)
Jan Kratochvil 979799f
     case_sensitivity = current_language->la_case_sensitivity;
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
@@ -437,7 +359,7 @@ set_language (enum language lang)
Jan Kratochvil 979799f
       if (languages[i]->la_language == lang)
Jan Kratochvil 979799f
 	{
Jan Kratochvil 979799f
 	  current_language = languages[i];
Jan Kratochvil 979799f
-	  set_type_range_case ();
Jan Kratochvil 979799f
+	  set_range_case ();
Jan Kratochvil 979799f
 	  break;
Jan Kratochvil 979799f
 	}
Jan Kratochvil 979799f
     }
Jan Kratochvil 979799f
@@ -461,8 +383,6 @@ language_info (int quietly)
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
   if (!quietly)
Jan Kratochvil 979799f
     {
Jan Kratochvil 979799f
-      printf_unfiltered (_("Type checking:     %s\n"), type);
Jan Kratochvil 979799f
-      show_type_command (NULL, 1, NULL, NULL);
Jan Kratochvil 979799f
       printf_unfiltered (_("Range checking:    %s\n"), range);
Jan Kratochvil 979799f
       show_range_command (NULL, 1, NULL, NULL);
Jan Kratochvil 979799f
       printf_unfiltered (_("Case sensitivity:  %s\n"), case_sensitive);
Jan Kratochvil 979799f
@@ -500,38 +420,11 @@ value_true (struct value *val)
Jan Kratochvil 979799f
    error messages that occur during type- and range-
Jan Kratochvil 979799f
    checking.  */
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-/* These are called when a language fails a type- or range-check.  The
Jan Kratochvil 979799f
+/* This is called when a language fails a range-check.  The
Jan Kratochvil 979799f
    first argument should be a printf()-style format string, and the
Jan Kratochvil 979799f
-   rest of the arguments should be its arguments.  If
Jan Kratochvil 979799f
-   [type|range]_check is [type|range]_check_on, an error is printed;
Jan Kratochvil 979799f
-   if [type|range]_check_warn, a warning; otherwise just the
Jan Kratochvil 979799f
-   message.  */
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-void
Jan Kratochvil 979799f
-type_error (const char *string,...)
Jan Kratochvil 979799f
-{
Jan Kratochvil 979799f
-  va_list args;
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-  va_start (args, string);
Jan Kratochvil 979799f
-  switch (type_check)
Jan Kratochvil 979799f
-    {
Jan Kratochvil 979799f
-    case type_check_warn:
Jan Kratochvil 979799f
-      vwarning (string, args);
Jan Kratochvil 979799f
-      break;
Jan Kratochvil 979799f
-    case type_check_on:
Jan Kratochvil 979799f
-      verror (string, args);
Jan Kratochvil 979799f
-      break;
Jan Kratochvil 979799f
-    case type_check_off:
Jan Kratochvil 979799f
-      /* FIXME: cagney/2002-01-30: Should this function print anything
Jan Kratochvil 979799f
-         when type error is off?  */
Jan Kratochvil 979799f
-      vfprintf_filtered (gdb_stderr, string, args);
Jan Kratochvil 979799f
-      fprintf_filtered (gdb_stderr, "\n");
Jan Kratochvil 979799f
-      break;
Jan Kratochvil 979799f
-    default:
Jan Kratochvil 979799f
-      internal_error (__FILE__, __LINE__, _("bad switch"));
Jan Kratochvil 979799f
-    }
Jan Kratochvil 979799f
-  va_end (args);
Jan Kratochvil 979799f
-}
Jan Kratochvil 979799f
+   rest of the arguments should be its arguments.  If range_check is
Jan Kratochvil 979799f
+   range_check_on, an error is printed;  if range_check_warn, a warning;
Jan Kratochvil 979799f
+   otherwise just the message.  */
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 void
Jan Kratochvil 979799f
 range_error (const char *string,...)
Jan Kratochvil 979799f
@@ -902,7 +795,6 @@ const struct language_defn unknown_langu
Jan Kratochvil 979799f
   "unknown",
Jan Kratochvil 979799f
   language_unknown,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
@@ -946,7 +838,6 @@ const struct language_defn auto_language
Jan Kratochvil 979799f
   "auto",
Jan Kratochvil 979799f
   language_auto,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
@@ -988,7 +879,6 @@ const struct language_defn local_languag
Jan Kratochvil 979799f
   "local",
Jan Kratochvil 979799f
   language_auto,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
@@ -1135,13 +1025,6 @@ _initialize_language (void)
Jan Kratochvil 979799f
   add_alias_cmd ("c", "check", no_class, 1, &showlist);
Jan Kratochvil 979799f
   add_alias_cmd ("ch", "check", no_class, 1, &showlist);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-  add_setshow_enum_cmd ("type", class_support, type_or_range_names, &type,
Jan Kratochvil 979799f
-			_("Set type checking.  (on/warn/off/auto)"),
Jan Kratochvil 979799f
-			_("Show type checking.  (on/warn/off/auto)"),
Jan Kratochvil 979799f
-			NULL, set_type_command,
Jan Kratochvil 979799f
-			show_type_command,
Jan Kratochvil 979799f
-			&setchecklist, &showchecklist);
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
   add_setshow_enum_cmd ("range", class_support, type_or_range_names,
Jan Kratochvil 979799f
 			&range,
Jan Kratochvil 979799f
 			_("Set range checking.  (on/warn/off/auto)"),
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/ada-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/ada-lang.c	2012-09-27 22:14:17.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/ada-lang.c	2012-09-27 22:14:41.112695245 +0200
Jan Kratochvil 979799f
@@ -12503,7 +12503,6 @@ const struct language_defn ada_language_
Jan Kratochvil 979799f
   "ada",                        /* Language name */
Jan Kratochvil 979799f
   language_ada,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,            /* Yes, Ada is case-insensitive, but
Jan Kratochvil 979799f
                                    that's not quite what this means.  */
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/c-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/c-lang.c	2012-07-06 07:46:04.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/c-lang.c	2012-09-27 22:14:41.141695257 +0200
Jan Kratochvil 979799f
@@ -831,7 +831,6 @@ const struct language_defn c_language_de
Jan Kratochvil 979799f
   "c",				/* Language name */
Jan Kratochvil 979799f
   language_c,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
@@ -955,7 +954,6 @@ const struct language_defn cplus_languag
Jan Kratochvil 979799f
   "c++",			/* Language name */
Jan Kratochvil 979799f
   language_cplus,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
@@ -997,7 +995,6 @@ const struct language_defn asm_language_
Jan Kratochvil 979799f
   "asm",			/* Language name */
Jan Kratochvil 979799f
   language_asm,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
@@ -1044,7 +1041,6 @@ const struct language_defn minimal_langu
Jan Kratochvil 979799f
   "minimal",			/* Language name */
Jan Kratochvil 979799f
   language_minimal,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/d-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/d-lang.c	2012-03-15 15:06:20.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/d-lang.c	2012-09-27 22:14:41.143695257 +0200
Jan Kratochvil 979799f
@@ -240,7 +240,6 @@ static const struct language_defn d_lang
Jan Kratochvil 979799f
   "d",
Jan Kratochvil 979799f
   language_d,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/f-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/f-lang.c	2012-09-27 22:14:23.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/f-lang.c	2012-09-27 22:14:41.151695260 +0200
Jan Kratochvil 979799f
@@ -260,7 +260,6 @@ const struct language_defn f_language_de
Jan Kratochvil 979799f
   "fortran",
Jan Kratochvil 979799f
   language_fortran,
Jan Kratochvil 979799f
   range_check_on,
Jan Kratochvil 979799f
-  type_check_on,
Jan Kratochvil 979799f
   case_sensitive_off,
Jan Kratochvil 979799f
   array_column_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/go-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/go-lang.c	2012-04-25 16:07:20.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/go-lang.c	2012-09-27 22:14:41.152695261 +0200
Jan Kratochvil 979799f
@@ -562,7 +562,6 @@ static const struct language_defn go_lan
Jan Kratochvil 979799f
   "go",
Jan Kratochvil 979799f
   language_go,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/jv-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/jv-lang.c	2012-09-27 22:14:23.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/jv-lang.c	2012-09-27 22:14:41.154695263 +0200
Jan Kratochvil 979799f
@@ -1169,7 +1169,6 @@ const struct language_defn java_language
Jan Kratochvil 979799f
   "java",			/* Language name */
Jan Kratochvil 979799f
   language_java,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/m2-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/m2-lang.c	2012-03-02 20:29:01.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/m2-lang.c	2012-09-27 22:14:41.161695266 +0200
Jan Kratochvil 979799f
@@ -370,7 +370,6 @@ const struct language_defn m2_language_d
Jan Kratochvil 979799f
   "modula-2",
Jan Kratochvil 979799f
   language_m2,
Jan Kratochvil 979799f
   range_check_on,
Jan Kratochvil 979799f
-  type_check_on,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/objc-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/objc-lang.c	2012-03-02 20:29:01.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/objc-lang.c	2012-09-27 22:14:41.163695268 +0200
Jan Kratochvil 979799f
@@ -509,7 +509,6 @@ const struct language_defn objc_language
Jan Kratochvil 979799f
   "objective-c",		/* Language name */
Jan Kratochvil 979799f
   language_objc,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/opencl-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/opencl-lang.c	2012-03-02 20:29:01.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/opencl-lang.c	2012-09-27 22:14:41.165695268 +0200
Jan Kratochvil 979799f
@@ -993,7 +993,6 @@ const struct language_defn opencl_langua
Jan Kratochvil 979799f
   "opencl",			/* Language name */
Jan Kratochvil 979799f
   language_opencl,
Jan Kratochvil 979799f
   range_check_off,
Jan Kratochvil 979799f
-  type_check_off,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_c,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/p-lang.c
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/p-lang.c	2012-03-02 20:29:01.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/p-lang.c	2012-09-27 22:14:41.170695270 +0200
Jan Kratochvil 979799f
@@ -429,7 +429,6 @@ const struct language_defn pascal_langua
Jan Kratochvil 979799f
   "pascal",			/* Language name */
Jan Kratochvil 979799f
   language_pascal,
Jan Kratochvil 979799f
   range_check_on,
Jan Kratochvil 979799f
-  type_check_on,
Jan Kratochvil 979799f
   case_sensitive_on,
Jan Kratochvil 979799f
   array_row_major,
Jan Kratochvil 979799f
   macro_expansion_no,
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/doc/gdb.texinfo
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/doc/gdb.texinfo	2012-09-27 22:14:23.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/doc/gdb.texinfo	2012-09-27 22:14:41.188695279 +0200
Jan Kratochvil 979799f
@@ -12648,29 +12648,18 @@ List all the filename extensions and the
Jan Kratochvil 979799f
 @node Checks
Jan Kratochvil 979799f
 @section Type and Range Checking
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-@quotation
Jan Kratochvil 979799f
-@emph{Warning:} In this release, the @value{GDBN} commands for type and range
Jan Kratochvil 979799f
-checking are included, but they do not yet have any effect.  This
Jan Kratochvil 979799f
-section documents the intended facilities.
Jan Kratochvil 979799f
-@end quotation
Jan Kratochvil 979799f
-@c FIXME remove warning when type/range code added
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 Some languages are designed to guard you against making seemingly common
Jan Kratochvil 979799f
 errors through a series of compile- and run-time checks.  These include
Jan Kratochvil 979799f
-checking the type of arguments to functions and operators, and making
Jan Kratochvil 979799f
+checking the type of arguments to functions and operators and making
Jan Kratochvil 979799f
 sure mathematical overflows are caught at run time.  Checks such as
Jan Kratochvil 979799f
 these help to ensure a program's correctness once it has been compiled
Jan Kratochvil 979799f
-by eliminating type mismatches, and providing active checks for range
Jan Kratochvil 979799f
+by eliminating type mismatches and providing active checks for range
Jan Kratochvil 979799f
 errors when your program is running.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-@value{GDBN} can check for conditions like the above if you wish.
Jan Kratochvil 979799f
-Although @value{GDBN} does not check the statements in your program,
Jan Kratochvil 979799f
-it can check expressions entered directly into @value{GDBN} for
Jan Kratochvil 979799f
-evaluation via the @code{print} command, for example.  As with the
Jan Kratochvil 979799f
-working language, @value{GDBN} can also decide whether or not to check
Jan Kratochvil 979799f
-automatically based on your program's source language.
Jan Kratochvil 979799f
-@xref{Supported Languages, ,Supported Languages}, for the default
Jan Kratochvil 979799f
-settings of supported languages.
Jan Kratochvil 979799f
+By default @value{GDBN} checks for these errors according to the
Jan Kratochvil 979799f
+rules of the current source language.  Although @value{GDBN} does not check
Jan Kratochvil 979799f
+the statements in your program, it can check expressions entered directly
Jan Kratochvil 979799f
+into @value{GDBN} for evaluation via the @code{print} command, for example.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @menu
Jan Kratochvil 979799f
 * Type Checking::               An overview of type checking
Jan Kratochvil 979799f
@@ -12682,69 +12671,51 @@ settings of supported languages.
Jan Kratochvil 979799f
 @node Type Checking
Jan Kratochvil 979799f
 @subsection An Overview of Type Checking
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-Some languages, such as Modula-2, are strongly typed, meaning that the
Jan Kratochvil 979799f
+Some languages, such as C and C@t{++}, are strongly typed, meaning that the
Jan Kratochvil 979799f
 arguments to operators and functions have to be of the correct type,
Jan Kratochvil 979799f
 otherwise an error occurs.  These checks prevent type mismatch
Jan Kratochvil 979799f
 errors from ever causing any run-time problems.  For example,
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @smallexample
Jan Kratochvil 979799f
-1 + 2 @result{} 3
Jan Kratochvil 979799f
+int klass::my_method(char *b) @{ return  b ? 1 : 2; @}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+(@value{GDBP}) print obj.my_method (0)
Jan Kratochvil 979799f
+$1 = 2
Jan Kratochvil 979799f
 @exdent but
Jan Kratochvil 979799f
-@error{} 1 + 2.3
Jan Kratochvil 979799f
+(@value{GDBP}) print obj.my_method (0x1234)
Jan Kratochvil 979799f
+Cannot resolve method klass::my_method to any overloaded instance
Jan Kratochvil 979799f
 @end smallexample
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-The second example fails because the @code{CARDINAL} 1 is not
Jan Kratochvil 979799f
-type-compatible with the @code{REAL} 2.3.
Jan Kratochvil 979799f
+The second example fails because in C@t{++} the integer constant
Jan Kratochvil 979799f
+@samp{0x1234} is not type-compatible with the pointer parameter type.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-For the expressions you use in @value{GDBN} commands, you can tell the
Jan Kratochvil 979799f
-@value{GDBN} type checker to skip checking;
Jan Kratochvil 979799f
+For the expressions you use in @value{GDBN} commands, you can tell
Jan Kratochvil 979799f
+@value{GDBN} to not enforce strict type checking or
Jan Kratochvil 979799f
 to treat any mismatches as errors and abandon the expression;
Jan Kratochvil 979799f
-or to only issue warnings when type mismatches occur,
Jan Kratochvil 979799f
-but evaluate the expression anyway.  When you choose the last of
Jan Kratochvil 979799f
-these, @value{GDBN} evaluates expressions like the second example above, but
Jan Kratochvil 979799f
-also issues a warning.
Jan Kratochvil 979799f
+When type checking is disabled, @value{GDBN} successfully evaluates
Jan Kratochvil 979799f
+expressions like the second example above.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-Even if you turn type checking off, there may be other reasons
Jan Kratochvil 979799f
+Even if type checking is off, there may be other reasons
Jan Kratochvil 979799f
 related to type that prevent @value{GDBN} from evaluating an expression.
Jan Kratochvil 979799f
 For instance, @value{GDBN} does not know how to add an @code{int} and
Jan Kratochvil 979799f
 a @code{struct foo}.  These particular type errors have nothing to do
Jan Kratochvil 979799f
-with the language in use, and usually arise from expressions, such as
Jan Kratochvil 979799f
-the one described above, which make little sense to evaluate anyway.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-Each language defines to what degree it is strict about type.  For
Jan Kratochvil 979799f
-instance, both Modula-2 and C require the arguments to arithmetical
Jan Kratochvil 979799f
-operators to be numbers.  In C, enumerated types and pointers can be
Jan Kratochvil 979799f
-represented as numbers, so that they are valid arguments to mathematical
Jan Kratochvil 979799f
-operators.  @xref{Supported Languages, ,Supported Languages}, for further
Jan Kratochvil 979799f
-details on specific languages.
Jan Kratochvil 979799f
+with the language in use and usually arise from expressions which make
Jan Kratochvil 979799f
+little sense to evaluate anyway.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-@value{GDBN} provides some additional commands for controlling the type checker:
Jan Kratochvil 979799f
+@value{GDBN} provides some additional commands for controlling type checking:
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @kindex set check type
Jan Kratochvil 979799f
 @kindex show check type
Jan Kratochvil 979799f
 @table @code
Jan Kratochvil 979799f
-@item set check type auto
Jan Kratochvil 979799f
-Set type checking on or off based on the current working language.
Jan Kratochvil 979799f
-@xref{Supported Languages, ,Supported Languages}, for the default settings for
Jan Kratochvil 979799f
-each language.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 @item set check type on
Jan Kratochvil 979799f
 @itemx set check type off
Jan Kratochvil 979799f
-Set type checking on or off, overriding the default setting for the
Jan Kratochvil 979799f
-current working language.  Issue a warning if the setting does not
Jan Kratochvil 979799f
-match the language default.  If any type mismatches occur in
Jan Kratochvil 979799f
+Set strict type checking on or off.  If any type mismatches occur in
Jan Kratochvil 979799f
 evaluating an expression while type checking is on, @value{GDBN} prints a
Jan Kratochvil 979799f
 message and aborts evaluation of the expression.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-@item set check type warn
Jan Kratochvil 979799f
-Cause the type checker to issue warnings, but to always attempt to
Jan Kratochvil 979799f
-evaluate the expression.  Evaluating the expression may still
Jan Kratochvil 979799f
-be impossible for other reasons.  For example, @value{GDBN} cannot add
Jan Kratochvil 979799f
-numbers and structures.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-@item show type
Jan Kratochvil 979799f
-Show the current setting of the type checker, and whether or not @value{GDBN}
Jan Kratochvil 979799f
-is setting it automatically.
Jan Kratochvil 979799f
+@item show check type
Jan Kratochvil 979799f
+Show the current setting of type checking and whether @value{GDBN}
Jan Kratochvil 979799f
+is enforcing strict type checking rules.
Jan Kratochvil 979799f
 @end table
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @cindex range checking
Jan Kratochvil 979799f
@@ -13195,8 +13166,8 @@ specification.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @cindex C and C@t{++} defaults
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-If you allow @value{GDBN} to set type and range checking automatically, they
Jan Kratochvil 979799f
-both default to @code{off} whenever the working language changes to
Jan Kratochvil 979799f
+If you allow @value{GDBN} to set range checking automatically, it
Jan Kratochvil 979799f
+defaults to @code{off} whenever the working language changes to
Jan Kratochvil 979799f
 C or C@t{++}.  This happens regardless of whether you or @value{GDBN}
Jan Kratochvil 979799f
 selects the working language.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
@@ -13207,37 +13178,15 @@ these files, it sets the working languag
Jan Kratochvil 979799f
 @xref{Automatically, ,Having @value{GDBN} Infer the Source Language},
Jan Kratochvil 979799f
 for further details.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-@c Type checking is (a) primarily motivated by Modula-2, and (b)
Jan Kratochvil 979799f
-@c unimplemented.  If (b) changes, it might make sense to let this node
Jan Kratochvil 979799f
-@c appear even if Mod-2 does not, but meanwhile ignore it. roland 16jul93.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
 @node C Checks
Jan Kratochvil 979799f
 @subsubsection C and C@t{++} Type and Range Checks
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 @cindex C and C@t{++} checks
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
-By default, when @value{GDBN} parses C or C@t{++} expressions, type checking
Jan Kratochvil 979799f
-is not used.  However, if you turn type checking on, @value{GDBN}
Jan Kratochvil 979799f
-considers two variables type equivalent if:
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-@itemize @bullet
Jan Kratochvil 979799f
-@item
Jan Kratochvil 979799f
-The two variables are structured and have the same structure, union, or
Jan Kratochvil 979799f
-enumerated tag.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-@item
Jan Kratochvil 979799f
-The two variables have the same type name, or types that have been
Jan Kratochvil 979799f
-declared equivalent through @code{typedef}.
Jan Kratochvil 979799f
-
Jan Kratochvil 979799f
-@ignore
Jan Kratochvil 979799f
-@c leaving this out because neither J Gilmore nor R Pesch understand it.
Jan Kratochvil 979799f
-@c FIXME--beers?
Jan Kratochvil 979799f
-@item
Jan Kratochvil 979799f
-The two @code{struct}, @code{union}, or @code{enum} variables are
Jan Kratochvil 979799f
-declared in the same declaration.  (Note: this may not be true for all C
Jan Kratochvil 979799f
-compilers.)
Jan Kratochvil 979799f
-@end ignore
Jan Kratochvil 979799f
-@end itemize
Jan Kratochvil 979799f
+By default, when @value{GDBN} parses C or C@t{++} expressions, strict type
Jan Kratochvil 979799f
+checking is used.  However, if you turn type checking off, @value{GDBN}
Jan Kratochvil 979799f
+will allow certain non-standard conversions, such as promoting integer
Jan Kratochvil 979799f
+constants to pointers.
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
 Range checking, if turned on, is done on mathematical operations.  Array
Jan Kratochvil 979799f
 indices are not checked, since they are often used to index a pointer
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/default.exp
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/default.exp	2012-04-27 22:52:06.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/default.exp	2012-09-27 22:14:41.312695333 +0200
Jan Kratochvil 979799f
@@ -495,12 +495,13 @@ gdb_test "section" "Must specify section
Jan Kratochvil 979799f
 gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
Jan Kratochvil 979799f
 #test set args
Jan Kratochvil 979799f
 gdb_test_no_output "set args" "set args"
Jan Kratochvil 979799f
-#test set check "c" abbreviation
Jan Kratochvil 979799f
-gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
Jan Kratochvil 979799f
-#test set check "ch" abbreviation
Jan Kratochvil 979799f
-gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
Jan Kratochvil 979799f
-#test set check
Jan Kratochvil 979799f
-gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test set check abbreviations
Jan Kratochvil 979799f
+foreach x {"c" "ch" "check"} {
Jan Kratochvil 979799f
+    gdb_test "set $x" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
Jan Kratochvil 979799f
+	"set check \"$x\" abbreviation"
Jan Kratochvil 979799f
+}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 #test set check range
Jan Kratochvil 979799f
 gdb_test "set check range" ".*" "set check range"
Jan Kratochvil 979799f
 #test set check type
Jan Kratochvil 979799f
@@ -577,16 +578,17 @@ gdb_test "shell echo Hi dad!" "Hi dad!"
Jan Kratochvil 979799f
 gdb_test "show annotate" "Annotation_level is 0." 	 "show annotate"
Jan Kratochvil 979799f
 #test show args
Jan Kratochvil 979799f
 gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
Jan Kratochvil 979799f
-#test show check "c" abbreviation
Jan Kratochvil 979799f
-gdb_test "show c" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
Jan Kratochvil 979799f
-#test show check "ch" abbreviation
Jan Kratochvil 979799f
-gdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
Jan Kratochvil 979799f
-#test show check
Jan Kratochvil 979799f
-gdb_test "show check" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\"." "show check"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# test show check abbreviations
Jan Kratochvil 979799f
+foreach x {"c" "ch" "check"} {
Jan Kratochvil 979799f
+    gdb_test "show $x" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Strict type checking is on\..*" \
Jan Kratochvil 979799f
+	"show check \"$x\" abbreviation"
Jan Kratochvil 979799f
+}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 #test show check range
Jan Kratochvil 979799f
 gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
Jan Kratochvil 979799f
 #test show check type
Jan Kratochvil 979799f
-gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
Jan Kratochvil 979799f
+gdb_test "show check type" "Strict type checking is on\." "show check type"
Jan Kratochvil 979799f
 #test show commands
Jan Kratochvil 979799f
 gdb_test "show commands" ".*" "show commands"
Jan Kratochvil 979799f
 #test show complaints
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/help.exp
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/help.exp	2012-07-02 19:53:19.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/help.exp	2012-09-27 22:14:41.315695333 +0200
Jan Kratochvil 979799f
@@ -376,22 +376,26 @@ gdb_test "help section" "Change the base
Jan Kratochvil 979799f
 gdb_test "help set annotate" "Set annotation_level\.\[\r\n\]+0 == normal;     1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help set annotate"
Jan Kratochvil 979799f
 # test help set args
Jan Kratochvil 979799f
 gdb_test "help set args" "Set argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
Jan Kratochvil 979799f
-# test help set check "c" abbreviation
Jan Kratochvil 979799f
-test_prefix_command_help {"set c" "set check"} {
Jan Kratochvil 979799f
-    "Set the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
-} "help set check \"c\" abbreviation"
Jan Kratochvil 979799f
-# test help set check "ch" abbreviation
Jan Kratochvil 979799f
-test_prefix_command_help {"set ch" "set check"} {
Jan Kratochvil 979799f
-    "Set the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
-} "help set check \"ch\" abbreviation"
Jan Kratochvil 979799f
-# test help set check
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test help set check abbreviations
Jan Kratochvil 979799f
+foreach x {"c" "ch"} {
Jan Kratochvil 979799f
+    test_prefix_command_help [list "set $x" "set check"] {
Jan Kratochvil 979799f
+	"Set the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
+    } "help set check \"$x\" abbreviation"
Jan Kratochvil 979799f
+}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test help set check
Jan Kratochvil 979799f
 test_prefix_command_help {"set check"} {
Jan Kratochvil 979799f
     "Set the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 # test help set check range
Jan Kratochvil 979799f
 gdb_test "help set check range" "Set range checking\.  \\(on/warn/off/auto\\)" "help set check range"
Jan Kratochvil 979799f
-# test help set check type
Jan Kratochvil 979799f
-gdb_test "help set check type" "Set type checking\.  \\(on/warn/off/auto\\)." "help set check type"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test help set check type
Jan Kratochvil 979799f
+gdb_test "help set check type" "Set strict type checking\." \
Jan Kratochvil 979799f
+    "help set check type"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 # test help set complaints
Jan Kratochvil 979799f
 gdb_test "help set complaints" "Set max number of complaints about incorrect symbols\." "help set complaints"
Jan Kratochvil 979799f
 # test help set confirm
Jan Kratochvil 979799f
@@ -487,18 +491,25 @@ gdb_test "help shell" "Execute the rest
Jan Kratochvil 979799f
 gdb_test "help show annotate" "Show annotation_level\.\[\r\n\]+0 == normal;     1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help show annotate"
Jan Kratochvil 979799f
 # test help show args
Jan Kratochvil 979799f
 gdb_test "help show args" "Show argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
Jan Kratochvil 979799f
-# test help show check "c" abbreviation
Jan Kratochvil 979799f
-test_prefix_command_help {"show c" "show check"} {
Jan Kratochvil 979799f
-    "Show the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
-} "help show check \"c\" abbreviation"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test help show check abbreviations
Jan Kratochvil 979799f
+foreach x {"c" "check"} {
Jan Kratochvil 979799f
+    test_prefix_command_help [list "show $x" "show check"] {
Jan Kratochvil 979799f
+	"Show the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
+    } "help show check \"$x\" abbreviation"
Jan Kratochvil 979799f
+}
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 # test help show check
Jan Kratochvil 979799f
 test_prefix_command_help {"show check"} {
Jan Kratochvil 979799f
     "Show the status of the type/range checker\.\[\r\n\]+"
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
 # test help show check range
Jan Kratochvil 979799f
 gdb_test "help show check range" "Show range checking\.  \\(on/warn/off/auto\\)" "help show check range"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 # test help show check type
Jan Kratochvil 979799f
-gdb_test "help show check type" "Show type checking\.  \\(on/warn/off/auto\\)" "help show check type"
Jan Kratochvil 979799f
+gdb_test "help show check type" "Show strict type checking\." \
Jan Kratochvil 979799f
+    "help show check type"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 # test help show commands
Jan Kratochvil 979799f
 gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands"
Jan Kratochvil 979799f
 # test help show complaints
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/setshow.exp
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/setshow.exp	2012-03-13 22:02:40.000000000 +0100
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/setshow.exp	2012-09-27 22:14:41.320695336 +0200
Jan Kratochvil 979799f
@@ -110,19 +110,22 @@ gdb_test "show check range" "Range check
Jan Kratochvil 979799f
 #test set check range auto
Jan Kratochvil 979799f
 gdb_test_no_output "set check range auto" "set check range auto" 
Jan Kratochvil 979799f
 #test show check range auto
Jan Kratochvil 979799f
-gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)" 
Jan Kratochvil 979799f
-#test set check type on
Jan Kratochvil 979799f
-gdb_test "set check type on" ".*" "set check type on" 
Jan Kratochvil 979799f
-#test show check type on
Jan Kratochvil 979799f
-gdb_test "show check type" "Type checking is \"on\"..*" "show check type (on)" 
Jan Kratochvil 979799f
-#test set check type off with trailing space
Jan Kratochvil 979799f
-gdb_test_no_output "set check type off " "set check type off" 
Jan Kratochvil 979799f
-#test show check type off
Jan Kratochvil 979799f
-gdb_test "show check type" "Type checking is \"off\"..*" "show check type (off)" 
Jan Kratochvil 979799f
-#test set check type auto
Jan Kratochvil 979799f
-gdb_test_no_output "set check type auto" "set check type auto" 
Jan Kratochvil 979799f
-#test show check type
Jan Kratochvil 979799f
-gdb_test "show check type" "Type checking is \"auto; currently .*" "show check type (auto)" 
Jan Kratochvil 979799f
+gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test set check type on
Jan Kratochvil 979799f
+gdb_test "set check type on" ".*" "set check type on"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test show check type on
Jan Kratochvil 979799f
+gdb_test "show check type" "Strict type checking is on\..*" \
Jan Kratochvil 979799f
+    "show check type (on)"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test set check type off with trailing space
Jan Kratochvil 979799f
+gdb_test_no_output "set check type off " "set check type off"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+# Test show check type off
Jan Kratochvil 979799f
+gdb_test "show check type" "Strict type checking is off\..*" \
Jan Kratochvil 979799f
+    "show check type (off)"
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 #test set complaints 100
Jan Kratochvil 979799f
 gdb_test_no_output "set complaints 100" "set complaints 100" 
Jan Kratochvil 979799f
 #test show complaints 100
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.exp
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.cp/converts.exp	2012-07-10 17:18:18.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.exp	2012-09-27 22:14:41.321695337 +0200
Jan Kratochvil 979799f
@@ -70,9 +70,37 @@ gdb_test_multiple "p foo3_1 (0, 0)" $t {
Jan Kratochvil 979799f
     pass $t
Jan Kratochvil 979799f
   }
Jan Kratochvil 979799f
 }
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 gdb_test "p foo3_1 (0, 1)" \
Jan Kratochvil 979799f
     "Cannot resolve function foo3_1 to any overloaded instance"
Jan Kratochvil 979799f
 gdb_test "p foo3_1 (0, (const char**) 1)" " = 31"
Jan Kratochvil 979799f
 gdb_test "p foo3_2 (0, 0)" "= 32"
Jan Kratochvil 979799f
 gdb_test "p foo3_2 (0, (char const**) 0)" " = 320"
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
+# Test for strict type checking
Jan Kratochvil 979799f
+set error_str "Cannot resolve function %s to any overloaded instance"
Jan Kratochvil 979799f
+gdb_test "show check type" "Strict type checking is on\."
Jan Kratochvil 979799f
+gdb_test "p foo1_type_check (123)" [format $error_str "foo1_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (0, 1)" [format $error_str "foo2_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (1, 0)" [format $error_str "foo2_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (1, 1)" [format $error_str "foo2_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 0, 1)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 1, 0)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 0, 0)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 1, 1)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 1, 0)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 1, 1)" [format $error_str "foo3_type_check"]
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
+gdb_test_no_output "set check type off"
Jan Kratochvil 979799f
+gdb_test "show check type" "Strict type checking is off\."
Jan Kratochvil 979799f
+gdb_test "p foo1_type_check (123)" " = 1000"
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (0, 1)" " = 1001"
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (1, 0)" " = 1001"
Jan Kratochvil 979799f
+gdb_test "p foo2_type_check (1, 1)" " = 1001"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 0, 1)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 1, 0)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 0, 0)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (0, 1, 1)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 1, 0)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_type_check (1, 1, 1)" " = 1002"
Jan Kratochvil 979799f
+gdb_test "p foo3_2 (1,1)" " = 32"
Jan Kratochvil 979799f
Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.cc
Jan Kratochvil 979799f
===================================================================
Jan Kratochvil 979799f
--- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.cp/converts.cc	2011-10-14 22:22:50.000000000 +0200
Jan Kratochvil 979799f
+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.cc	2012-09-27 22:14:41.322695337 +0200
Jan Kratochvil 979799f
@@ -27,6 +27,10 @@ int foo3_1 (int a, const char **b) { ret
Jan Kratochvil 979799f
 int foo3_2 (int a, int b) { return 32; }
Jan Kratochvil 979799f
 int foo3_2 (int a, const char **b) { return 320; }
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
+int foo1_type_check (char *a) { return 1000; }
Jan Kratochvil 979799f
+int foo2_type_check (char *a, char *b) { return 1001; }
Jan Kratochvil 979799f
+int foo3_type_check (char *a, char *b, char *c) { return 1002; }
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
 int main()
Jan Kratochvil 979799f
 {
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
@@ -62,5 +66,9 @@ int main()
Jan Kratochvil 979799f
   foo3_2 (0, static_cast<char const**> (0));
Jan Kratochvil 979799f
   foo3_2 (0, 0);
Jan Kratochvil 979799f
 
Jan Kratochvil 979799f
+  foo1_type_check (a);
Jan Kratochvil 979799f
+  foo2_type_check (a, a);
Jan Kratochvil 979799f
+  foo3_type_check (a, a, a);
Jan Kratochvil 979799f
+
Jan Kratochvil 979799f
   return 0;          // end of main
Jan Kratochvil 979799f
 }