This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcc-in-cxx] Fix opts.c for C++


I committed this patch the gcc-in-cxx branch to fix opts.c so that it
compiles with C++.

Ian


2009-02-03  Ian Lance Taylor  <iant@google.com>

	* opts.c (set_debug_level): Don't put an arbitrary int in an
	enum.


Index: opts.c
===================================================================
--- opts.c	(revision 143890)
+++ opts.c	(working copy)
@@ -2238,15 +2238,17 @@ set_debug_level (enum debug_info_type ty
   if (*arg == '\0')
     {
       if (!debug_info_level)
-	debug_info_level = 2;
+	debug_info_level = DINFO_LEVEL_NORMAL;
     }
   else
     {
-      debug_info_level = integral_argument (arg);
-      if (debug_info_level == (unsigned int) -1)
+      int argval = integral_argument (arg);
+      if (argval == -1)
 	error ("unrecognised debug output level \"%s\"", arg);
-      else if (debug_info_level > 3)
+      else if (argval > 3)
 	error ("debug output level %s is too high", arg);
+      else
+	debug_info_level = (enum debug_info_level) argval;
     }
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]