Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2010 00:34:06 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201006200034.o5K0Y6xl041024@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006200034.o5K0Y6xl041024>