cpplib: Default language handling, part 1

Neil Booth neilb@earthling.net
Sun Nov 19 08:56:00 GMT 2000


This implements specifying a default language when calling
cpp_reader_init.  It doesn't yet update the front-ends to use this
feature properly - it just changes them to request GNUC89, since this
means effectively initialising as we do now.

Setting the front ends up to do it properly will require a couple of
minor changes to the ObjectiveC and CPP front ends - I'll put those in
separate patches.

Also, a bunch of comment updates.

Neil.

	* c-lang.c (lang_init_options): Update call to
	cpp_reader_init.
	* cppmain.c (main): Similarly.
	* fix-header.c (read_scan_file): Similarly.
	* cp/lex.c (lang_init_options): Similarly.
	* objc/objc-act.c (lang_init_options): Similarly.
	* cppexp.c (parse_number): Only warn for unextended C89.
	* cpphash.h (VALID_SIGN): Only disallow P for unextended C89.
	* cppinit.c (set_lang): New function.
	(cpp_reader_init): Take a LANG argument and pass it to set_lang.
	(COMMAND_LINE_OPTIONS): New option std=c++98.
	(cpp_handle_option): Use set_lang.
	* cpplex.c (_cpp_lex_token): Warn pedantically if not C99.
	* cppib.h (enum_c_lang): New enumeration.  Update comments.

Index: c-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lang.c,v
retrieving revision 1.36
diff -u -p -r1.36 c-lang.c
--- c-lang.c	2000/11/10 04:29:43	1.36
+++ c-lang.c	2000/11/19 16:41:29
@@ -58,7 +58,7 @@ lang_init_options ()
 {
 #if USE_CPPLIB
   cpp_init ();
-  cpp_reader_init (&parse_in);
+  cpp_reader_init (&parse_in, CLK_GNUC89);
 #endif
   /* Mark as "unspecified".  */
   flag_bounds_check = -1;
Index: cppexp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppexp.c,v
retrieving revision 1.79
diff -u -p -r1.79 cppexp.c
--- cppexp.c	2000/11/14 18:32:05	1.79
+++ cppexp.c	2000/11/19 16:41:57
@@ -205,7 +205,9 @@ parse_number (pfile, tok)
 
       if (CPP_WTRADITIONAL (pfile) && sufftab[i].u)
 	cpp_warning (pfile, "traditional C rejects the `U' suffix");
-      if (CPP_OPTION (pfile, c89) && sufftab[i].l == 2)
+      if (CPP_OPTION (pfile, c89)
+	  && sufftab[i].l == 2
+	  && pfile->spec_nodes.n__STRICT_ANSI__->type == NT_MACRO)
 	SYNTAX_ERROR ("too many 'l' suffixes in integer constant");
     }
   
Index: cpphash.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpphash.h,v
retrieving revision 1.80
diff -u -p -r1.80 cpphash.h
--- cpphash.h	2000/11/14 18:32:05	1.80
+++ cpphash.h	2000/11/19 16:41:57
@@ -22,11 +22,14 @@ Foundation, 59 Temple Place - Suite 330,
 #ifndef __GCC_CPPHASH__
 #define __GCC_CPPHASH__
 
-/* Test if a sign is valid within a preprocessing number.  */
+/* Test if a sign is valid within a preprocessing number.  The hexadecimal
+   floating point stuff is only disallowed for standard C89.  */
 #define VALID_SIGN(c, prevc) \
   (((c) == '+' || (c) == '-') && \
    ((prevc) == 'e' || (prevc) == 'E' \
-    || (((prevc) == 'p' || (prevc) == 'P') && !CPP_OPTION (pfile, c89))))
+    || (((prevc) == 'p' || (prevc) == 'P') \
+        && (CPP_OPTION (pfile, c89) == 0 \
+            || pfile->spec_nodes.n__STRICT_ANSI__->type == NT_MACRO))))
 
 /* Memory pools.  */
 #define ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.115
diff -u -p -r1.115 cppinit.c
--- cppinit.c	2000/11/18 12:18:09	1.115
+++ cppinit.c	2000/11/19 16:42:03
@@ -105,6 +105,7 @@ static void merge_include_chains	PARAMS 
 static void do_includes			PARAMS ((cpp_reader *,
 						 struct pending_option *,
 						 int));
+static void set_lang			PARAMS ((cpp_reader *, enum c_lang));
 static void initialize_dependency_output PARAMS ((cpp_reader *));
 static void initialize_standard_includes PARAMS ((cpp_reader *));
 static void new_pending_directive	PARAMS ((struct cpp_pending *,
@@ -421,10 +422,111 @@ cpp_init ()
   cpp_init_completed = 1;
 }
 
+/* Sets internal flags correctly for a given language, and defines
+   macros if necessary.  */
+static void
+set_lang (pfile, lang)
+     cpp_reader *pfile;
+     enum c_lang lang;
+{
+  struct cpp_pending *pend = CPP_OPTION (pfile, pending);
+
+  /* Default to zero.  */
+  CPP_OPTION (pfile, lang_asm) = 0;
+  CPP_OPTION (pfile, objc) = 0;
+  CPP_OPTION (pfile, cplusplus) = 0;
+
+  switch (lang)
+    {
+      /* GNU C.  */
+    case CLK_GNUC99:
+      CPP_OPTION (pfile, trigraphs) = 0;
+      CPP_OPTION (pfile, dollars_in_ident) = 1;
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 1;
+      CPP_OPTION (pfile, c89) = 0;
+      CPP_OPTION (pfile, c99) = 1;
+      new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
+      break;
+    case CLK_GNUC89:
+      CPP_OPTION (pfile, trigraphs) = 0;
+      CPP_OPTION (pfile, dollars_in_ident) = 1;
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 0;
+      CPP_OPTION (pfile, c89) = 1;
+      CPP_OPTION (pfile, c99) = 0;
+      break;
+
+      /* ISO C.  */
+    case CLK_STDC94:
+      new_pending_directive (pend, "__STDC_VERSION__=199409L", cpp_define);
+    case CLK_STDC89:
+      CPP_OPTION (pfile, trigraphs) = 1;
+      CPP_OPTION (pfile, dollars_in_ident) = 0;
+      CPP_OPTION (pfile, cplusplus_comments) = 0;
+      CPP_OPTION (pfile, digraphs) = lang == CLK_STDC94;
+      CPP_OPTION (pfile, c89) = 1;
+      CPP_OPTION (pfile, c99) = 0;
+      new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
+      break;
+    case CLK_STDC99:
+      CPP_OPTION (pfile, trigraphs) = 1;
+      CPP_OPTION (pfile, dollars_in_ident) = 0;
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 1;
+      CPP_OPTION (pfile, c89) = 0;
+      CPP_OPTION (pfile, c99) = 1;
+      new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
+      new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
+      break;
+
+      /* Objective C.  */
+    case CLK_OBJCXX:
+      new_pending_directive (pend, "__cplusplus", cpp_define);
+      CPP_OPTION (pfile, cplusplus) = 1;
+    case CLK_OBJC:
+      CPP_OPTION (pfile, trigraphs) = 0;
+      CPP_OPTION (pfile, dollars_in_ident) = 1;
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 1;
+      CPP_OPTION (pfile, c89) = 0;
+      CPP_OPTION (pfile, c99) = 0;
+      CPP_OPTION (pfile, objc) = 1;
+      new_pending_directive (pend, "__OBJC__", cpp_define);
+      break;
+
+      /* C++.  */
+    case CLK_GNUCXX:
+    case CLK_CXX98:
+      CPP_OPTION (pfile, cplusplus) = 1;
+      CPP_OPTION (pfile, trigraphs) = lang == CLK_CXX98;
+      CPP_OPTION (pfile, dollars_in_ident) = lang == CLK_GNUCXX;
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 1;
+      CPP_OPTION (pfile, c89) = 0;
+      CPP_OPTION (pfile, c99) = 0;
+      new_pending_directive (pend, "__cplusplus", cpp_define);
+      break;
+
+      /* Assembler.  */
+    case CLK_ASM:
+      CPP_OPTION (pfile, trigraphs) = 0;
+      CPP_OPTION (pfile, dollars_in_ident) = 0;	/* Maybe not?  */
+      CPP_OPTION (pfile, cplusplus_comments) = 1;
+      CPP_OPTION (pfile, digraphs) = 0; 
+     CPP_OPTION (pfile, c89) = 0;
+      CPP_OPTION (pfile, c99) = 0;
+      CPP_OPTION (pfile, lang_asm) = 1;
+      new_pending_directive (pend, "__ASSEMBLER__", cpp_define);
+      break;
+    }
+}
+
 /* Initialize a cpp_reader structure. */
 void
-cpp_reader_init (pfile)
+cpp_reader_init (pfile, lang)
      cpp_reader *pfile;
+     enum c_lang lang;
 {
   struct spec_nodes *s;
 
@@ -439,11 +541,9 @@ cpp_reader_init (pfile)
       cpp_init ();
     }
 
-  CPP_OPTION (pfile, dollars_in_ident) = 1;
-  CPP_OPTION (pfile, cplusplus_comments) = 1;
+  set_lang (pfile, lang);
   CPP_OPTION (pfile, warn_import) = 1;
   CPP_OPTION (pfile, warn_paste) = 1;
-  CPP_OPTION (pfile, digraphs) = 1;
   CPP_OPTION (pfile, discard_comments) = 1;
   CPP_OPTION (pfile, show_column) = 1;
   CPP_OPTION (pfile, tabstop) = 8;
@@ -1077,6 +1177,7 @@ new_pending_directive (pend, text, handl
   DEF_OPT("pedantic",                 0,      OPT_pedantic)                   \
   DEF_OPT("pedantic-errors",          0,      OPT_pedantic_errors)            \
   DEF_OPT("remap",                    0,      OPT_remap)                      \
+  DEF_OPT("std=c++98",                0,      OPT_std_cplusplus98)            \
   DEF_OPT("std=c89",                  0,      OPT_std_c89)                    \
   DEF_OPT("std=c99",                  0,      OPT_std_c99)                    \
   DEF_OPT("std=c9x",                  0,      OPT_std_c9x)                    \
@@ -1324,93 +1425,52 @@ cpp_handle_option (pfile, argc, argv)
 	  CPP_OPTION (pfile, include_prefix_len) = strlen (arg);
 	  break;
 	case OPT_lang_c:
-	  CPP_OPTION (pfile, cplusplus) = 0;
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 0;
-	  CPP_OPTION (pfile, c99) = 1;
-	  CPP_OPTION (pfile, digraphs) = 1;
-	  CPP_OPTION (pfile, objc) = 0;
+	  set_lang (pfile, CLK_GNUC99);
 	  break;
 	case OPT_lang_cplusplus:
-	  CPP_OPTION (pfile, cplusplus) = 1;
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 0;
-	  CPP_OPTION (pfile, c99) = 0;
-	  CPP_OPTION (pfile, objc) = 0;
-	  CPP_OPTION (pfile, digraphs) = 1;
-	  new_pending_directive (pend, "__cplusplus", cpp_define);
+	  set_lang (pfile, CLK_GNUCXX);
 	  break;
-	case OPT_lang_objcplusplus:
-	  CPP_OPTION (pfile, cplusplus) = 1;
-	  new_pending_directive (pend, "__cplusplus", cpp_define);
-	  /* fall through */
 	case OPT_lang_objc:
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 0;
-	  CPP_OPTION (pfile, c99) = 0;
-	  CPP_OPTION (pfile, objc) = 1;
-	  new_pending_directive (pend, "__OBJC__", cpp_define);
+	  set_lang (pfile, CLK_OBJC);
 	  break;
-	case OPT_lang_asm:
- 	  CPP_OPTION (pfile, lang_asm) = 1;
-	  CPP_OPTION (pfile, dollars_in_ident) = 0;
-	  new_pending_directive (pend, "__ASSEMBLER__", cpp_define);
+	case OPT_lang_objcplusplus:
+	  set_lang (pfile, CLK_OBJCXX);
 	  break;
-	case OPT_nostdinc:
-	  /* -nostdinc causes no default include directories.
-	     You must specify all include-file directories with -I.  */
-	  CPP_OPTION (pfile, no_standard_includes) = 1;
+	case OPT_lang_asm:
+	  set_lang (pfile, CLK_ASM);
 	  break;
-	case OPT_nostdincplusplus:
-	  /* -nostdinc++ causes no default C++-specific include directories. */
-	  CPP_OPTION (pfile, no_standard_cplusplus_includes) = 1;
+	case OPT_std_cplusplus98:
+	  set_lang (pfile, CLK_CXX98);
 	  break;
 	case OPT_std_gnu89:
-	  CPP_OPTION (pfile, cplusplus) = 0;
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 1;
-	  CPP_OPTION (pfile, c99) = 0;
-	  CPP_OPTION (pfile, objc) = 0;
-	  CPP_OPTION (pfile, digraphs) = 1;
+	  set_lang (pfile, CLK_GNUC89);
 	  break;
 	case OPT_std_gnu9x:
 	case OPT_std_gnu99:
-	  CPP_OPTION (pfile, cplusplus) = 0;
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 0;
-	  CPP_OPTION (pfile, c99) = 1;
-	  CPP_OPTION (pfile, digraphs) = 1;
-	  CPP_OPTION (pfile, objc) = 0;
-	  new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
+	  set_lang (pfile, CLK_GNUC99);
 	  break;
 	case OPT_std_iso9899_199409:
-	  new_pending_directive (pend, "__STDC_VERSION__=199409L", cpp_define);
-	  /* Fall through */
+	  set_lang (pfile, CLK_STDC94);
+	  break;
 	case OPT_std_iso9899_1990:
 	case OPT_std_c89:
 	case OPT_lang_c89:
-	  CPP_OPTION (pfile, cplusplus) = 0;
-	  CPP_OPTION (pfile, cplusplus_comments) = 0;
-	  CPP_OPTION (pfile, c89) = 1;
-	  CPP_OPTION (pfile, c99) = 0;
-	  CPP_OPTION (pfile, objc) = 0;
-	  CPP_OPTION (pfile, digraphs) = opt_code == OPT_std_iso9899_199409;
-	  CPP_OPTION (pfile, trigraphs) = 1;
-	  new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
+	  set_lang (pfile, CLK_STDC89);
 	  break;
 	case OPT_std_iso9899_199x:
 	case OPT_std_iso9899_1999:
 	case OPT_std_c9x:
 	case OPT_std_c99:
-	  CPP_OPTION (pfile, cplusplus) = 0;
-	  CPP_OPTION (pfile, cplusplus_comments) = 1;
-	  CPP_OPTION (pfile, c89) = 0;
-	  CPP_OPTION (pfile, c99) = 1;
-	  CPP_OPTION (pfile, objc) = 0;
-	  CPP_OPTION (pfile, digraphs) = 1;
-	  CPP_OPTION (pfile, trigraphs) = 1;
-	  new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
-	  new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
+	  set_lang (pfile, CLK_STDC99);
+	  break;
+	case OPT_nostdinc:
+	  /* -nostdinc causes no default include directories.
+	     You must specify all include-file directories with -I.  */
+	  CPP_OPTION (pfile, no_standard_includes) = 1;
+	  break;
+	case OPT_nostdincplusplus:
+	  /* -nostdinc++ causes no default C++-specific include directories. */
+	  CPP_OPTION (pfile, no_standard_cplusplus_includes) = 1;
 	  break;
 	case OPT_o:
 	  if (CPP_OPTION (pfile, out_fname) != NULL)
Index: cpplex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpplex.c,v
retrieving revision 1.119
diff -u -p -r1.119 cpplex.c
--- cpplex.c	2000/11/14 18:32:06	1.119
+++ cpplex.c	2000/11/19 16:42:07
@@ -1007,7 +1007,7 @@ _cpp_lex_token (pfile, result)
 	     irrespective of conformance mode, because lots of
 	     broken systems do that and trying to clean it up in
 	     fixincludes is a nightmare.  */
-	  if (CPP_OPTION (pfile, c89) && CPP_PEDANTIC (pfile)
+	  if (! CPP_OPTION (pfile, c99) && CPP_PEDANTIC (pfile)
 	      && ! buffer->warned_cplusplus_comments)
 	    {
 	      cpp_pedwarn (pfile,
Index: cpplib.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpplib.h,v
retrieving revision 1.136
diff -u -p -r1.136 cpplib.h
--- cpplib.h	2000/11/15 19:25:22	1.136
+++ cpplib.h	2000/11/19 16:42:10
@@ -152,6 +152,10 @@ enum cpp_ttype
 #undef OP
 #undef TK
 
+/* C language kind, used when calling cpp_reader_init.  */
+enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99,
+	     CLK_GNUCXX, CLK_CXX98, CLK_OBJC, CLK_OBJCXX, CLK_ASM};
+
 /* Multiple-include optimisation.  */
 enum mi_state {MI_FAILED = 0, MI_OUTSIDE};
 enum mi_ind {MI_IND_NONE = 0, MI_IND_NOT};
@@ -168,7 +172,7 @@ struct cpp_string
 #define DIGRAPH		(1 << 1) /* If it was a digraph.  */
 #define STRINGIFY_ARG	(1 << 2) /* If macro argument to be stringified.  */
 #define PASTE_LEFT	(1 << 3) /* If on LHS of a ## operator.  */
-#define NAMED_OP	(1 << 4) /* C++ named operators, also "defined".  */
+#define NAMED_OP	(1 << 4) /* C++ named operators.  */
 #define NO_EXPAND	(1 << 5) /* Do not macro-expand this token.  */
 
 /* A preprocessing token.  This has been carefully packed and should
@@ -518,7 +522,7 @@ struct spec_nodes
   cpp_hashnode *n__VA_ARGS__;		/* C99 vararg macros */
 };
 
-/* a cpp_reader encapsulates the "state" of a pre-processor run.
+/* A cpp_reader encapsulates the "state" of a pre-processor run.
    Applying cpp_get_token repeatedly yields a stream of pre-processor
    tokens.  Usually, there is only one cpp_reader object active.  */
 
@@ -711,33 +715,34 @@ union tree_node;
 
 struct cpp_hashnode
 {
-  const unsigned char *name;		/* null-terminated name */
-  unsigned int hash;			/* cached hash value */
-  unsigned short length;		/* length of name excluding null */
-  unsigned short arg_index;		/* macro argument index */
-  unsigned char directive_index;	/* index into directive table.  */
-  ENUM_BITFIELD(node_type) type : 8;	/* node type.  */
-  unsigned char flags;			/* node flags.  */
+  const unsigned char *name;		/* Null-terminated name.  */
+  unsigned int hash;			/* Cached hash value.  */
+  unsigned short length;		/* Length of name excluding null.  */
+  unsigned short arg_index;		/* Macro argument index.  */
+  unsigned char directive_index;	/* Index into directive table.  */
+  ENUM_BITFIELD(node_type) type : 8;	/* Node type.  */
+  unsigned char flags;			/* Node flags.  */
 
   union
   {
-    cpp_macro *macro;			/* a macro.  */
-    struct answer *answers;		/* answers to an assertion.  */
-    enum cpp_ttype operator;		/* code for a named operator.  */
-    enum builtin_type builtin;		/* code for a builtin macro.  */
+    cpp_macro *macro;			/* If a macro.  */
+    struct answer *answers;		/* Answers to an assertion.  */
+    enum cpp_ttype operator;		/* Code for a named operator.  */
+    enum builtin_type builtin;		/* Code for a builtin macro.  */
   } value;
 
-  union tree_node *fe_value;		/* front end value */
+  union tree_node *fe_value;		/* Front end value.  */
 };
 
 extern unsigned int cpp_token_len PARAMS ((const cpp_token *));
-extern unsigned char *cpp_token_as_text PARAMS ((cpp_reader *, const cpp_token *));
+extern unsigned char *cpp_token_as_text PARAMS ((cpp_reader *,
+						 const cpp_token *));
 extern unsigned char *cpp_spell_token PARAMS ((cpp_reader *, const cpp_token *,
 					       unsigned char *));
 extern void cpp_init PARAMS ((void));
 extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
 extern int cpp_handle_option PARAMS ((cpp_reader *, int, char **));
-extern void cpp_reader_init PARAMS ((cpp_reader *));
+extern void cpp_reader_init PARAMS ((cpp_reader *, enum c_lang));
 
 extern void cpp_register_pragma PARAMS ((cpp_reader *,
 					 const char *, const char *,
Index: cppmain.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppmain.c,v
retrieving revision 1.39
diff -u -p -r1.39 cppmain.c
--- cppmain.c	2000/11/01 08:53:36	1.39
+++ cppmain.c	2000/11/19 16:42:11
@@ -87,7 +87,8 @@ main (argc, argv)
   (void) textdomain (PACKAGE);
 
   cpp_init ();
-  cpp_reader_init (pfile);
+  /* Default language is GNU C89.  */
+  cpp_reader_init (pfile, CLK_GNUC89);
   
   argi += cpp_handle_options (pfile, argc - argi , argv + argi);
   if (argi < argc && ! CPP_FATAL_ERRORS (pfile))
Index: fix-header.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fix-header.c,v
retrieving revision 1.51
diff -u -p -r1.51 fix-header.c
--- fix-header.c	2000/11/19 13:15:50	1.51
+++ fix-header.c	2000/11/19 16:42:15
@@ -611,7 +611,7 @@ read_scan_file (in_fname, argc, argv)
   obstack_init (&scan_file_obstack); 
 
   cpp_init ();			/* Initialize cpplib.   */
-  cpp_reader_init (&scan_in);
+  cpp_reader_init (&scan_in, CLK_GNUC89);
 
   /* We are going to be scanning a header file out of its proper context,
      so ignore warnings and errors.  */
Index: cp/lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lex.c,v
retrieving revision 1.225
diff -u -p -r1.225 lex.c
--- lex.c	2000/11/17 17:31:12	1.225
+++ lex.c	2000/11/19 16:42:44
@@ -254,7 +254,7 @@ lang_init_options ()
 {
 #if USE_CPPLIB
   cpp_init ();
-  cpp_reader_init (&parse_in);
+  cpp_reader_init (&parse_in, CLK_GNUC89);
 #endif
 
   /* Default exceptions on.  */
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.52
diff -u -p -r1.52 objc-act.c
--- objc-act.c	2000/11/07 22:50:06	1.52
+++ objc-act.c	2000/11/19 16:42:58
@@ -700,7 +700,7 @@ lang_init_options ()
 {
 #if USE_CPPLIB
   cpp_init ();
-  cpp_reader_init (&parse_in);
+  cpp_reader_init (&parse_in, CLK_GNUC89);
 #endif
 }
 
Index: testsuite/gcc.dg/cpp/macsyntx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/macsyntx.c,v
retrieving revision 1.7
diff -u -p -r1.7 macsyntx.c
--- macsyntx.c	2000/10/29 17:43:57	1.7
+++ macsyntx.c	2000/11/19 16:43:08
@@ -1,7 +1,7 @@
 /* Copyright (C) 2000 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
-/* { dg-options -pedantic } */
+/* { dg-options "-pedantic -std=gnu99" } */
 
 /* Tests macro syntax, for both definition and invocation, including:-
 


More information about the Gcc-patches mailing list