svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common

Marcel Moolenaar marcel at FreeBSD.org
Sun Jun 20 00:34:07 UTC 2010


Author: marcel
Date: Sun Jun 20 00:34:06 2010
New Revision: 209358
URL: http://svn.freebsd.org/changeset/base/209358

Log:
  Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't
  satisfied with a simple cast to int in the check against EOF, so the fix
  is a bit involved by actually having to go through a temporary variable.

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Sat Jun 19 22:13:40 2010	(r209357)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Sun Jun 20 00:34:06 2010	(r209358)
@@ -67,8 +67,12 @@
  * for all subsequent invocations, which is the effect desired.
  */
 #undef  unput
-#define unput(c) \
-	if (c != EOF) yyunput( c, yytext_ptr )
+#define unput(c)					\
+	do {						\
+		int _c = c;				\
+		if (_c != EOF)				\
+			yyunput(_c, yytext_ptr);	\
+	} while(0)
 #endif
 
 static int id_or_type(const char *);


More information about the svn-src-head mailing list