Patch for s/ANSI C/ISO C/

Joseph S. Myers jsm28@cam.ac.uk
Tue Aug 8 14:56:00 GMT 2000


This patch changes references to ANSI C in messages from the C
compiler to refer to ISO C or ISO C89.  It doesn't change most
references in #if 0 blocks or in comments.

Bootstrapped with no regressions on i686-pc-linux-gnu.  OK to commit?

2000-08-08  Joseph S. Myers  <jsm28@cam.ac.uk>

	* c-common.c (combine_strings, check_format_info): Refer to ISO C
	or ISO C89 instead of ANSI C.
	* c-decl.c (grokdeclarator, xref_tag, finish_struct,
	build_enumerator, do_case): Likewise.
	* c-lex.c (parse_float, yylex): Likewise.
	* c-parse.in: Likewise.
	* c-typeck.c (common_type, build_array_ref, build_binary_op,
	build_unary_op, pedantic_lvalue_warning, build_conditional_expr,
	build_c_cast, convert_for_assignment, set_init_index,
	set_init_label, c_expand_start_case): Likewise.
	* toplev.c (documented_lang_options, display_help): Likewise.

--- c-common.c	Sun Aug  6 18:08:43 2000
+++ c-common.c.new	Tue Aug  8 19:27:49 2000
@@ -375,8 +375,8 @@ combine_strings (strings)
   nchars = wide_flag ? length / wchar_bytes : length;
 
   if (pedantic && nchars > nchars_max)
-    pedwarn ("string length `%d' is greater than the minimum length `%d' ANSI C is required to support",
-	     nchars, nchars_max);
+    pedwarn ("string length `%d' is greater than the minimum length `%d' ISO C%d is required to support",
+	     nchars, nchars_max, flag_isoc99 ? 99 : 89);
 
   /* Create the array type for the string constant.
      -Wwrite-strings says make the string constant an array of const char
@@ -1653,7 +1653,7 @@ check_format_info (info, params)
 	  while (*format_chars != 0 && index ("_-0^#", *format_chars) != 0)
 	    {
 	      if (pedantic)
-		warning ("ANSI C does not support the strftime `%c' flag",
+		warning ("ISO C does not support the strftime `%c' flag",
 			 *format_chars);
 	      if (index (flag_chars, *format_chars) != 0)
 		{
@@ -1674,7 +1674,7 @@ check_format_info (info, params)
               ++format_chars;
 	    }
 	  if (wide && pedantic)
-	    warning ("ANSI C does not support strftime format width");
+	    warning ("ISO C does not support strftime format width");
 	  if (*format_chars == 'E' || *format_chars == 'O')
 	    {
 	      i = strlen (flag_chars);
@@ -1704,7 +1704,7 @@ check_format_info (info, params)
 		  int opnum = atoi (format_chars);
 
 		  if (pedantic)
-		    warning ("ANSI C does not support printf %%n$");
+		    warning ("ISO C does not support printf %%n$");
 
 		  params = first_fillin_param;
 		  format_chars = p + 1;
@@ -1743,7 +1743,7 @@ check_format_info (info, params)
 	      && index (flag_chars, '-') != 0)
 	    warning ("use of both `0' and `-' flags in format");
 	  if (index (flag_chars, '\'') && pedantic)
-	    warning ("ANSI C does not support the `'' format flag");
+	    warning ("ISO C does not support the `'' format flag");
 	  if (*format_chars == '*')
 	    {
 	      wide = TRUE;
@@ -1826,21 +1826,27 @@ check_format_info (info, params)
 	    {
 	      length_char = *format_chars++;
 	      if (length_char == 'q' && pedantic)
-		warning ("ANSI C does not support the `%c' length modifier",
+		warning ("ISO C does not support the `%c' length modifier",
 			 length_char);
 	    }
 	  else if (*format_chars == 'Z' || *format_chars == 'z')
 	    {
 	      length_char = *format_chars++;
-	      if (pedantic && (length_char == 'Z' || !flag_isoc99))
-		warning ("ANSI C does not support the `%c' length modifier",
-			 length_char);
+	      if (pedantic)
+		{
+		  if (length_char == 'Z')
+		    warning ("ISO C does not support the `%c' length modifier",
+			     length_char);
+		  else if (!flag_isoc99)
+		    warning ("ISO C89 does not support the `%c' length modifier",
+			     length_char);
+		}
 	    }
 	  else if (*format_chars == 't' || *format_chars == 'j')
 	    {
 	      length_char = *format_chars++;
 	      if (pedantic && !flag_isoc99)
-		warning ("ANSI C does not support the `%c' length modifier",
+		warning ("ISO C89 does not support the `%c' length modifier",
 			 length_char);
 	    }
 	  else
@@ -1849,13 +1855,13 @@ check_format_info (info, params)
 	    {
 	      length_char = 'q', format_chars++;
 	      if (pedantic && !flag_isoc99)
-		warning ("ANSI C does not support the `ll' length modifier");
+		warning ("ISO C89 does not support the `ll' length modifier");
 	    }
 	  else if (length_char == 'h' && *format_chars == 'h')
 	    {
 	      length_char = 'H', format_chars++;
 	      if (pedantic && !flag_isoc99)
-		warning ("ANSI C does not support the `hh' length modifier");
+		warning ("ISO C89 does not support the `hh' length modifier");
 	    }
 	  if (*format_chars == 'a' && info->format_type == scanf_format_type)
 	    {
@@ -1880,12 +1886,12 @@ check_format_info (info, params)
       /* The m, C, and S formats are GNU extensions.  */
       if (pedantic && info->format_type != strftime_format_type
 	  && (format_char == 'm' || format_char == 'C' || format_char == 'S'))
-	warning ("ANSI C does not support the `%c' format", format_char);
+	warning ("ISO C does not support the `%c' format", format_char);
       /* The a, A and F formats are C99 extensions.  */
       if (pedantic && info->format_type != strftime_format_type
 	  && (format_char == 'a' || format_char == 'A' || format_char == 'F')
 	  && !flag_isoc99)
-	warning ("ANSI C does not support the `%c' format", format_char);
+	warning ("ISO C89 does not support the `%c' format", format_char);
       format_chars++;
       switch (info->format_type)
 	{
@@ -1917,15 +1923,18 @@ check_format_info (info, params)
       if (pedantic)
 	{
 	  if (index (fci->flag_chars, 'G') != 0)
-	    warning ("ANSI C does not support `%%%c'", format_char);
+	    warning ("ISO C does not support `%%%c'", format_char);
 	  if (index (fci->flag_chars, '9') != 0 && !flag_isoc99)
-	    warning ("ANSI C does not support `%%%c'", format_char);
-	  if ((index (fci->flag_chars, 'o') != 0
-	       || (!flag_isoc99 && index (fci->flag_chars, 'O') != 0))
-	      && index (flag_chars, 'O') != 0)
-	    warning ("ANSI C does not support `%%O%c'", format_char);
+	    warning ("ISO C89 does not support `%%%c'", format_char);
+	  if (index (flag_chars, 'O') != 0)
+	    {
+	      if (index (fci->flag_chars, 'o') != 0)
+		warning ("ISO C does not support `%%O%c'", format_char);
+	      else if (!flag_isoc99 && index (fci->flag_chars, 'O') != 0)
+		warning ("ISO C89 does not support `%%O%c'", format_char);
+	    }
 	  if (!flag_isoc99 && index (flag_chars, 'E'))
-	    warning ("ANSI C does not support `%%E%c'", format_char);
+	    warning ("ISO C89 does not support `%%E%c'", format_char);
 	}
       if (wide && index (fci->flag_chars, 'w') == 0)
 	warning ("width used with `%c' format", format_char);
@@ -1944,7 +1953,7 @@ check_format_info (info, params)
 	}
       /* The a flag is a GNU extension.  */
       else if (pedantic && aflag)
-	warning ("ANSI C does not support the `a' flag");
+	warning ("ISO C does not support the `a' flag");
       if (info->format_type == scanf_format_type && format_char == '[')
 	{
 	  /* Skip over scan set, in case it happens to have '%' in it.  */
@@ -2004,20 +2013,20 @@ check_format_info (info, params)
 		    || format_char == 'e' || format_char == 'E'
 		    || format_char == 'f' || format_char == 'F'
 		    || format_char == 'g' || format_char == 'G'))
-	warning ("ANSI C does not support the `L' length modifier with the `%c' type character",
+	warning ("ISO C does not support the `L' length modifier with the `%c' type character",
 		 format_char);
       else if (length_char == 'l'
 	       && (format_char == 'c' || format_char == 's'
 		   || format_char == '[')
 	       && pedantic && !flag_isoc94)
-	warning ("ANSI C89 does not support the `l' length modifier with the `%c' type character",
+	warning ("ISO C89 does not support the `l' length modifier with the `%c' type character",
 		 format_char);
       else if (info->format_type == printf_format_type && pedantic
 	       && !flag_isoc99 && length_char == 'l'
 	       && (format_char == 'f' || format_char == 'e'
 		   || format_char == 'E' || format_char == 'g'
 		   || format_char == 'G'))
-	warning ("ANSI C does not support the `l' length modifier with the `%c' type character",
+	warning ("ISO C89 does not support the `l' length modifier with the `%c' type character",
 		 format_char);
 
       /* Finally. . .check type of argument against desired type!  */
--- c-decl.c	Sun Aug  6 18:08:43 2000
+++ c-decl.c.new	Tue Aug  8 19:31:02 2000
@@ -4005,7 +4005,7 @@ grokdeclarator (declarator, declspecs, d
 		      {
 			if (pedantic && !flag_isoc99 && ! in_system_header
 			    && warn_long_long)
-			  pedwarn ("ANSI C does not support `long long'");
+			  pedwarn ("ISO C89 does not support `long long'");
 			longlong = 1;
 		      }
 		  }
@@ -4385,7 +4385,7 @@ grokdeclarator (declarator, declspecs, d
 		}
 
 	      if (pedantic && integer_zerop (size))
-		pedwarn ("ANSI C forbids zero-size array `%s'", name);
+		pedwarn ("ISO C forbids zero-size array `%s'", name);
 
 	      if (TREE_CODE (size) == INTEGER_CST)
 		{
@@ -4405,9 +4405,9 @@ grokdeclarator (declarator, declspecs, d
 		  if (pedantic)
 		    {
 		      if (TREE_CONSTANT (size))
-			pedwarn ("ANSI C forbids array `%s' whose size can't be evaluated", name);
+			pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated", name);
 		      else
-			pedwarn ("ANSI C forbids variable-size array `%s'", name);
+			pedwarn ("ISO C89 forbids variable-size array `%s'", name);
 		    }
 		}
 
@@ -4539,7 +4539,7 @@ grokdeclarator (declarator, declspecs, d
 
 	  if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
 	      && type_quals)
-	    pedwarn ("ANSI C forbids qualified function types");
+	    pedwarn ("ISO C forbids qualified function types");
 	  if (type_quals)
 	    type = c_build_qualified_type (type, type_quals);
 	  type_quals = TYPE_UNQUALIFIED;
@@ -4612,7 +4612,7 @@ grokdeclarator (declarator, declspecs, d
 	 in typenames, fields or parameters */
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
 	  && type_quals)
-	pedwarn ("ANSI C forbids qualified function types");
+	pedwarn ("ISO C forbids qualified function types");
       if (type_quals)
 	type = c_build_qualified_type (type, type_quals);
       decl = build_decl (TYPE_DECL, declarator, type);
@@ -4646,7 +4646,7 @@ grokdeclarator (declarator, declspecs, d
 	 in typenames, fields or parameters */
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
 	  && type_quals)
-	pedwarn ("ANSI C forbids const or volatile function types");
+	pedwarn ("ISO C forbids const or volatile function types");
       if (type_quals)
 	type = c_build_qualified_type (type, type_quals);
       return type;
@@ -4696,7 +4696,7 @@ grokdeclarator (declarator, declspecs, d
 	else if (TREE_CODE (type) == FUNCTION_TYPE)
 	  {
 	    if (pedantic && type_quals)
-	      pedwarn ("ANSI C forbids qualified function types");
+	      pedwarn ("ISO C forbids qualified function types");
 	    if (type_quals)
 	      type = c_build_qualified_type (type, type_quals);
 	    type = build_pointer_type (type);
@@ -4782,13 +4782,13 @@ grokdeclarator (declarator, declspecs, d
 	decl = build_decl_attribute_variant (decl, decl_machine_attr);
 
 	if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl))
-	  pedwarn ("ANSI C forbids qualified function types");
+	  pedwarn ("ISO C forbids qualified function types");
 
 	if (pedantic
 	    && VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))
 	    && TYPE_QUALS (TREE_TYPE (TREE_TYPE (decl)))
 	    && ! DECL_IN_SYSTEM_HEADER (decl))
-	  pedwarn ("ANSI C forbids qualified void function return type");
+	  pedwarn ("ISO C forbids qualified void function return type");
 
 	/* GNU C interprets a `volatile void' return type to indicate
 	   that the function does not return.  */
@@ -5161,7 +5161,7 @@ xref_tag (code, name)
     {
       /* (In ANSI, Enums can be referred to only if already defined.)  */
       if (pedantic)
-	pedwarn ("ANSI C forbids forward references to `enum' types");
+	pedwarn ("ISO C forbids forward references to `enum' types");
       /* Give the type a default layout like unsigned int
 	 to avoid crashing if it does not get defined.  */
       TYPE_MODE (ref) = TYPE_MODE (unsigned_type_node);
@@ -5354,7 +5354,7 @@ finish_struct (t, fieldlist, attributes)
 	  && !(TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE
 	       && (TYPE_PRECISION (TREE_TYPE (x))
 		   == TYPE_PRECISION (integer_type_node))))
-	pedwarn_with_decl (x, "bit-field `%s' type invalid in ANSI C");
+	pedwarn_with_decl (x, "bit-field `%s' type invalid in ISO C");
 
       /* Detect and ignore out of range field width and process valid
 	 field widths.  */
@@ -5749,7 +5749,7 @@ build_enumerator (name, value)
 
   if (pedantic && ! int_fits_type_p (value, integer_type_node))
     {
-      pedwarn ("ANSI C restricts enumerator values to range of `int'");
+      pedwarn ("ISO C restricts enumerator values to range of `int'");
       value = convert (integer_type_node, value);
     }
 
@@ -6924,7 +6924,7 @@ do_case (low_value, high_value)
   label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
   
   if (pedantic && (high_value != NULL_TREE))
-    pedwarn ("ANSI C forbids case ranges");
+    pedwarn ("ISO C forbids case ranges");
 
   if (value1 != error_mark_node && value2 != error_mark_node)
     {
@@ -6933,7 +6933,7 @@ do_case (low_value, high_value)
       
       if (high_value == NULL_TREE && value1 != NULL_TREE &&
 	  pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value1)))
-	pedwarn ("label must have integral type in ANSI C");
+	pedwarn ("label must have integral type in ISO C");
       
       if (low_value == NULL_TREE)
 	success = pushcase (NULL_TREE, 0, label, &duplicate);
--- c-lex.c	Tue Aug  8 08:17:48 2000
+++ c-lex.c.new	Tue Aug  8 19:32:14 2000
@@ -1122,7 +1122,7 @@ parse_float (data)
 	  if (args->imag)
 	    error ("more than one `i' or `j' in numeric constant");
 	  else if (pedantic)
-	    pedwarn ("ANSI C forbids imaginary numeric constants");
+	    pedwarn ("ISO C forbids imaginary numeric constants");
 	  args->imag = 1;
 	  break;
 
@@ -1789,7 +1789,7 @@ yylex ()
 			  error ("`Ll' and `lL' are not valid integer suffixes");
 			else if (pedantic && ! flag_isoc99
 				 && ! in_system_header && warn_long_long)
-			  pedwarn ("ANSI C forbids long long integer constants");
+			  pedwarn ("ISO C89 forbids long long integer constants");
 			spec_long_long = 1;
 		      }
 		    spec_long = c;
@@ -1799,7 +1799,7 @@ yylex ()
 		    if (spec_imag)
 		      error ("more than one `i' or `j' in numeric constant");
 		    else if (pedantic)
-		      pedwarn ("ANSI C forbids imaginary numeric constants");
+		      pedwarn ("ISO C forbids imaginary numeric constants");
 		    spec_imag = 1;
 		  }
 		else
@@ -1914,7 +1914,7 @@ yylex ()
 		  warning ("width of integer constant changes with -traditional");
 		else if (TREE_UNSIGNED (traditional_type)
 			 != TREE_UNSIGNED (ansi_type))
-		  warning ("integer constant is unsigned in ANSI C, signed with -traditional");
+		  warning ("integer constant is unsigned in ISO C, signed with -traditional");
 		else
 		  warning ("width of integer constant may change on other systems with -traditional");
 	      }
@@ -2018,7 +2018,7 @@ yylex ()
 	    else if (c == '\n')
 	      {
 		if (pedantic)
-		  pedwarn ("ANSI C forbids newline in character constant");
+		  pedwarn ("ISO C forbids newline in character constant");
 		lineno++;
 	      }
 	    else
@@ -2175,7 +2175,7 @@ yylex ()
 	    else if (c == '\n')
 	      {
 		if (pedantic)
-		  pedwarn ("ANSI C forbids newline in string constant");
+		  pedwarn ("ISO C forbids newline in string constant");
 		lineno++;
 	      }
 	    else
--- c-parse.in	Mon Aug  7 09:46:01 2000
+++ c-parse.in.new	Tue Aug  8 19:35:46 2000
@@ -277,7 +277,7 @@ end ifobjc
 %%
 program: /* empty */
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids an empty source file");
+		    pedwarn ("ISO C forbids an empty source file");
 		  finish_file ();
 		}
 	| extdefs
@@ -320,7 +320,7 @@ end ifobjc
 datadef:
 	  setspecs notype_initdecls ';'
 		{ if (pedantic)
-		    error ("ANSI C forbids data definition with no type or storage class");
+		    error ("ISO C forbids data definition with no type or storage class");
 		  else if (!flag_traditional)
 		    warning ("data definition has no type or storage class"); 
 
@@ -343,7 +343,7 @@ datadef:
 	| error '}'
 	| ';'
 		{ if (pedantic)
-		    pedwarn ("ANSI C does not allow extra `;' outside of a function"); }
+		    pedwarn ("ISO C does not allow extra `;' outside of a function"); }
 	;
 
 fndef:
@@ -459,7 +459,7 @@ unary_expr:
 	| ANDAND identifier
 		{ tree label = lookup_label ($2);
 		  if (pedantic)
-		    pedwarn ("ANSI C forbids `&&'");
+		    pedwarn ("ISO C forbids `&&'");
 		  if (label == 0)
 		    $$ = null_pointer_node;
 		  else
@@ -479,7 +479,7 @@ unary_expr:
 		  else
 		    {
 		      if (pedantic)
-			pedwarn ("ANSI C forbids `&...'");
+			pedwarn ("ISO C forbids `&...'");
 		      $$ = tree_last (DECL_ARGUMENTS (current_function_decl));
 		      $$ = build_unary_op (ADDR_EXPR, $$, 0);
 		    } }
@@ -531,7 +531,7 @@ cast_expr:
 		  finish_init ();
 
 		  if (pedantic && ! flag_isoc99)
-		    pedwarn ("ANSI C forbids constructor expressions");
+		    pedwarn ("ISO C89 forbids constructor expressions");
 		  if (TYPE_NAME (type) != 0)
 		    {
 		      if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
@@ -600,7 +600,7 @@ expr_no_commas:
 		  $$ = build_conditional_expr ($1, $4, $7); }
 	| expr_no_commas '?'
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
+		    pedwarn ("ISO C forbids omitting the middle term of a ?: expression");
 		  /* Make sure first operand is calculated only once.  */
 		  $<ttype>2 = save_expr ($1);
 		  $1 = truthvalue_conversion (default_conversion ($<ttype>2));
@@ -648,7 +648,7 @@ primary:
 	| compstmt_primary_start compstmt_nostart ')'
 		{ tree rtl_exp;
 		  if (pedantic)
-		    pedwarn ("ANSI C forbids braced-groups within expressions");
+		    pedwarn ("ISO C forbids braced-groups within expressions");
 		  pop_iterator_stack ();
 		  pop_label_level ();
 		  rtl_exp = expand_end_stmt_expr ($1);
@@ -769,7 +769,7 @@ old_style_parm_decls:
 		/* ... is used here to indicate a varargs function.  */
 		{ c_mark_varargs ();
 		  if (pedantic)
-		    pedwarn ("ANSI C does not permit use of `varargs.h'"); }
+		    pedwarn ("ISO C does not permit use of `varargs.h'"); }
 	;
 
 /* The following are analogous to lineno_decl, decls and decl
@@ -1112,7 +1112,7 @@ init:
 initlist_maybe_comma:
 	  /* empty */
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids empty initializer braces"); }
+		    pedwarn ("ISO C forbids empty initializer braces"); }
 	| initlist1 maybecomma
 	;
 
@@ -1164,7 +1164,7 @@ end ifc
 nested_function:
 	  declarator
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids nested functions");
+		    pedwarn ("ISO C forbids nested functions");
 
 		  push_function_context ();
 		  if (! start_function (current_declspecs, $1,
@@ -1190,7 +1190,7 @@ nested_function:
 notype_nested_function:
 	  notype_declarator
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids nested functions");
+		    pedwarn ("ISO C forbids nested functions");
 
 		  push_function_context ();
 		  if (! start_function (current_declspecs, $1,
@@ -1442,7 +1442,7 @@ component_decl:
 		     structs or unions (which is [a] useful and [b] supports 
 		     MS P-SDK).  */
 		  if (pedantic)
-		    pedwarn ("ANSI C doesn't support unnamed structs/unions");
+		    pedwarn ("ISO C doesn't support unnamed structs/unions");
 
 		  $$ = grokfield($3, $4, NULL, current_declspecs, NULL_TREE);
 		  current_declspecs = TREE_VALUE (declspec_stack);
@@ -1456,7 +1456,7 @@ component_decl:
 		  declspec_stack = TREE_CHAIN (declspec_stack); }
 	| nonempty_type_quals
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids member declarations with no members");
+		    pedwarn ("ISO C forbids member declarations with no members");
 		  shadow_tag($1);
 		  $$ = NULL_TREE; }
 	| error
@@ -1570,7 +1570,7 @@ stmts:
 	lineno_stmt_or_labels
 		{
 		  if (pedantic && $1)
-		    pedwarn ("ANSI C forbids label at end of compound statement");
+		    pedwarn ("ISO C forbids label at end of compound statement");
 		}
 	;
 
@@ -1608,7 +1608,7 @@ maybe_label_decls:
 	  /* empty */
 	| label_decls
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids label declarations"); }
+		    pedwarn ("ISO C forbids label declarations"); }
 	;
 
 label_decls:
@@ -1919,7 +1919,7 @@ stmt:
 		}
 	| GOTO '*' expr ';'
 		{ if (pedantic)
-		    pedwarn ("ANSI C forbids `goto *expr;'");
+		    pedwarn ("ISO C forbids `goto *expr;'");
 		  stmt_count++;
 		  emit_line_note ($<filename>-1, $<lineno>0);
 		  expand_computed_goto (convert (ptr_type_node, $3)); }
@@ -2072,7 +2072,7 @@ parmlist_1:
 	| parms ';'
 		{ tree parm;
 		  if (pedantic)
-		    pedwarn ("ANSI C forbids forward parameter declarations");
+		    pedwarn ("ISO C forbids forward parameter declarations");
 		  /* Mark the forward decls as such.  */
 		  for (parm = getdecls (); parm; parm = TREE_CHAIN (parm))
 		    TREE_ASM_WRITTEN (parm) = 1;
@@ -2095,7 +2095,7 @@ parmlist_2:  /* empty */
 		     it caused problems with the code in expand_builtin which
 		     tries to verify that BUILT_IN_NEXT_ARG is being used
 		     correctly.  */
-		  error ("ANSI C requires a named argument before `...'");
+		  error ("ISO C requires a named argument before `...'");
 		}
 	| parms
 		{ $$ = get_parm_info (1); }
--- c-typeck.c	Mon Jul 31 23:18:12 2000
+++ c-typeck.c.new	Tue Aug  8 19:39:54 2000
@@ -388,7 +388,7 @@ common_type (t1, t2)
 		    {
 		      TREE_VALUE (n) = TREE_VALUE (p2);
 		      if (pedantic)
-			pedwarn ("function types not truly compatible in ANSI C");
+			pedwarn ("function types not truly compatible in ISO C");
 		      goto parm_done;
 		    }
 	      }
@@ -402,7 +402,7 @@ common_type (t1, t2)
 		    {
 		      TREE_VALUE (n) = TREE_VALUE (p1);
 		      if (pedantic)
-			pedwarn ("function types not truly compatible in ANSI C");
+			pedwarn ("function types not truly compatible in ISO C");
 		      goto parm_done;
 		    }
 	      }
@@ -1318,9 +1318,9 @@ build_array_ref (array, index)
       if (pedantic && !lvalue_p (array))
 	{
 	  if (DECL_REGISTER (array))
-	    pedwarn ("ANSI C forbids subscripting `register' array");
+	    pedwarn ("ISO C forbids subscripting `register' array");
 	  else
-	    pedwarn ("ANSI C forbids subscripting non-lvalue array");
+	    pedwarn ("ISO C89 forbids subscripting non-lvalue array");
 	}
 
       if (pedantic)
@@ -1329,7 +1329,7 @@ build_array_ref (array, index)
 	  while (TREE_CODE (foo) == COMPONENT_REF)
 	    foo = TREE_OPERAND (foo, 0);
 	  if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
-	    pedwarn ("ANSI C forbids subscripting non-lvalue array");
+	    pedwarn ("ISO C89 forbids subscripting non-lvalue array");
 	}
 
       type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
@@ -2198,13 +2198,13 @@ build_binary_op (code, orig_op0, orig_op
 		 whose value is 0 but which isn't a valid null ptr const.  */
 	      if (pedantic && (!integer_zerop (op0) || op0 != orig_op0)
 		  && TREE_CODE (tt1) == FUNCTION_TYPE)
-		pedwarn ("ANSI C forbids comparison of `void *' with function pointer");
+		pedwarn ("ISO C forbids comparison of `void *' with function pointer");
 	    }
 	  else if (VOID_TYPE_P (tt1))
 	    {
 	      if (pedantic && (!integer_zerop (op1) || op1 != orig_op1)
 		  && TREE_CODE (tt0) == FUNCTION_TYPE)
-		pedwarn ("ANSI C forbids comparison of `void *' with function pointer");
+		pedwarn ("ISO C forbids comparison of `void *' with function pointer");
 	    }
 	  else
 	    pedwarn ("comparison of distinct pointer types lacks a cast");
@@ -2244,7 +2244,7 @@ build_binary_op (code, orig_op0, orig_op
 	      result_type = common_type (type0, type1);
 	      if (pedantic 
 		  && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
-		pedwarn ("ANSI C forbids ordered comparisons of pointers to functions");
+		pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
 	    }
 	  else
 	    {
@@ -2272,7 +2272,7 @@ build_binary_op (code, orig_op0, orig_op
 		pedwarn ("comparison of complete and incomplete pointers");
 	      else if (pedantic 
 		       && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
-		pedwarn ("ANSI C forbids ordered comparisons of pointers to functions");
+		pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
 	    }
 	  else
 	    {
@@ -3057,7 +3057,7 @@ build_unary_op (code, xarg, noconvert)
 	case FIX_ROUND_EXPR:
 	case FIX_CEIL_EXPR:
 	  if (pedantic)
-	    pedwarn ("ANSI C forbids the address of a cast expression");
+	    pedwarn ("ISO C forbids the address of a cast expression");
 	  return convert (build_pointer_type (TREE_TYPE (arg)),
 			  build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0),
 					  0));
@@ -3268,13 +3268,13 @@ pedantic_lvalue_warning (code)
     switch (code)
       {
       case COND_EXPR:
-	pedwarn ("ANSI C forbids use of conditional expressions as lvalues");
+	pedwarn ("ISO C forbids use of conditional expressions as lvalues");
 	break;
       case COMPOUND_EXPR:
-	pedwarn ("ANSI C forbids use of compound expressions as lvalues");
+	pedwarn ("ISO C forbids use of compound expressions as lvalues");
 	break;
       default:
-	pedwarn ("ANSI C forbids use of cast expressions as lvalues");
+	pedwarn ("ISO C forbids use of cast expressions as lvalues");
 	break;
       }
 }
@@ -3490,7 +3490,7 @@ build_conditional_expr (ifexp, op1, op2)
   else if (code1 == VOID_TYPE || code2 == VOID_TYPE)
     {
       if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE))
-	pedwarn ("ANSI C forbids conditional expr with only one void side");
+	pedwarn ("ISO C forbids conditional expr with only one void side");
       result_type = void_type_node;
     }
   else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE)
@@ -3506,13 +3506,13 @@ build_conditional_expr (ifexp, op1, op2)
       else if (VOID_TYPE_P (TREE_TYPE (type1)))
 	{
 	  if (pedantic && TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
-	    pedwarn ("ANSI C forbids conditional expr between `void *' and function pointer");
+	    pedwarn ("ISO C forbids conditional expr between `void *' and function pointer");
 	  result_type = qualify_type (type1, type2);
 	}
       else if (VOID_TYPE_P (TREE_TYPE (type2)))
 	{
 	  if (pedantic && TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
-	    pedwarn ("ANSI C forbids conditional expr between `void *' and function pointer");
+	    pedwarn ("ISO C forbids conditional expr between `void *' and function pointer");
 	  result_type = qualify_type (type2, type1);
 	}
       else
@@ -3684,7 +3684,7 @@ build_c_cast (type, expr)
 	{
 	  if (TREE_CODE (type) == RECORD_TYPE
 	      || TREE_CODE (type) == UNION_TYPE)
-	    pedwarn ("ANSI C forbids casting nonscalar to the same type");
+	    pedwarn ("ISO C forbids casting nonscalar to the same type");
 	}
     }
   else if (TREE_CODE (type) == UNION_TYPE)
@@ -3705,7 +3705,7 @@ build_c_cast (type, expr)
 	  tree t;
 
 	  if (pedantic)
-	    pedwarn ("ANSI C forbids casts to union type");
+	    pedwarn ("ISO C forbids casts to union type");
 	  if (TYPE_NAME (type) != 0)
 	    {
 	      if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
@@ -4164,7 +4164,7 @@ convert_for_assignment (type, rhs, errty
 	    }
 	  
 	  if (pedantic && ! DECL_IN_SYSTEM_HEADER (fundecl))
-	    pedwarn ("ANSI C prohibits argument conversion to union type");
+	    pedwarn ("ISO C prohibits argument conversion to union type");
 
 	  return build1 (NOP_EXPR, type, rhs);
 	}
@@ -4193,7 +4193,7 @@ convert_for_assignment (type, rhs, errty
 		      which are not ANSI null ptr constants.  */
 		   && (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR)
 		   && TREE_CODE (ttl) == FUNCTION_TYPE)))
-	    warn_for_assignment ("ANSI forbids %s between function pointer and `void *'",
+	    warn_for_assignment ("ISO C forbids %s between function pointer and `void *'",
 				 errtype, funname, parmnum);
 	  /* Const and volatile mean something different for function types,
 	     so the usual warnings are not appropriate.  */
@@ -5609,7 +5609,7 @@ set_init_index (first, last)
       else
 	{
 	  if (pedantic)
-	    pedwarn ("ANSI C forbids specifying element to initialize");
+	    pedwarn ("ISO C89 forbids specifying element to initialize");
 
 	  constructor_range_end = last ? convert (bitsizetype, last) : 0;
 	}
@@ -5649,7 +5649,7 @@ set_init_label (fieldname)
     {
       constructor_fields = tail;
       if (pedantic)
-	pedwarn ("ANSI C forbids specifying structure member to initialize");
+	pedwarn ("ISO C89 forbids specifying structure member to initialize");
     }
 }
 
@@ -6740,7 +6740,7 @@ c_expand_start_case (exp)
 	  && ! in_system_header
 	  && (type == long_integer_type_node
 	      || type == long_unsigned_type_node))
-	warning ("`long' switch expression not converted to `int' in ANSI C");
+	warning ("`long' switch expression not converted to `int' in ISO C");
 
       exp = default_conversion (exp);
       type = TREE_TYPE (exp);
--- toplev.c	Sun Aug  6 10:24:53 2000
+++ toplev.c.new	Tue Aug  8 19:41:03 2000
@@ -1135,7 +1135,7 @@ documented_lang_options[] =
      used here is to only describe those options which are not
      enabled by default.  */
 
-  { "-ansi", "Compile just for ANSI C" },
+  { "-ansi", "Compile just for ISO C89" },
   { "-fallow-single-precision",
     "Do not promote floats to double if using -traditional" },
   { "-std= ", "Determine language standard"},
@@ -1236,7 +1236,7 @@ documented_lang_options[] =
   { "-Wno-unknown-pragmas", "" },
   { "-Wstrict-prototypes", "Warn about non-prototyped function decls" },
   { "-Wno-strict-prototypes", "" },
-  { "-Wtraditional", "Warn about constructs whose meaning change in ANSI C"},
+  { "-Wtraditional", "Warn about constructs whose meaning change in ISO C"},
   { "-Wno-traditional", "" },
   { "-Wtrigraphs", "Warn when trigraphs are encountered" },
   { "-Wno-trigraphs", "" },
@@ -3741,7 +3741,7 @@ display_help ()
 
   printf (_("  -O[number]              Set optimisation level to [number]\n"));
   printf (_("  -Os                     Optimise for space rather than speed\n"));
-  printf (_("  -pedantic               Issue warnings needed by strict compliance to ANSI C\n"));
+  printf (_("  -pedantic               Issue warnings needed by strict compliance to ISO C\n"));
   printf (_("  -pedantic-errors        Like -pedantic except that errors are produced\n"));
   printf (_("  -w                      Suppress warnings\n"));
   printf (_("  -W                      Enable extra warnings\n"));

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list