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]

[fixinc patch] Reduce bogus applications of limits_ifndefs


I believe this change doesn't change behavior at all (the fix does nothing
unless the select passes), but eliminates bogus invocations of this test.

Bruce, could you vet this?

	* inclhack.def (limits_ifndefs): Add select test.
	* fixincl.x: Rebuild.

Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.158
diff -u -1 -2 -r1.158 inclhack.def
--- inclhack.def	2 Jul 2003 01:30:10 -0000	1.158
+++ inclhack.def	8 Jul 2003 20:24:43 -0000
@@ -1600,24 +1600,26 @@
  *  comment.  Fortunately, HP/UX already uses #ifndefs in limits.h; if
  *  we find a #ifndef FLT_MIN we assume that all the required #ifndefs
  *  are there, and we do not add them ourselves.
  *
  *  QNX Software Systems also guards the defines, but doesn't define
  *  FLT_MIN.  Therefore, bypass the fix for *either* guarded FLT_MIN
  *  or guarded FLT_MAX.
  */
 fix = {
     hackname = limits_ifndefs;
     files  = "sys/limits.h";
     files  = "limits.h";
+    select = "^[ \t]*#[ \t]*define[ \t]+"
+             "((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
     bypass = "ifndef[ \t]+FLT_(MIN|MAX)";
 
     c_fix     = format;
     c_fix_arg = "#ifndef %1\n%0\n#endif";
     c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+"
                 "((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
     test_text = " #\tdefine\tDBL_DIG \t 0  /* somthin' */";
 };
 
 
 /*
  *  Delete the '#define void int' line from curses.h on Lynx

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html


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