From owner-svn-src-all@FreeBSD.ORG Tue Apr 10 15:29:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C44C106564A; Tue, 10 Apr 2012 15:29:29 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C208FC14; Tue, 10 Apr 2012 15:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AFTTA9029570; Tue, 10 Apr 2012 15:29:29 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AFTTj6029568; Tue, 10 Apr 2012 15:29:29 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201204101529.q3AFTTj6029568@svn.freebsd.org> From: Jens Schweikhardt Date: Tue, 10 Apr 2012 15:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234101 - head/usr.bin/lex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 15:29:29 -0000 Author: schweikh Date: Tue Apr 10 15:29:28 2012 New Revision: 234101 URL: http://svn.freebsd.org/changeset/base/234101 Log: Parenthesize args in yyless() and unput() replacement text so they are safer when used with expressions. MFC after: 1 week Modified: head/usr.bin/lex/flex.skl Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Tue Apr 10 14:29:56 2012 (r234100) +++ head/usr.bin/lex/flex.skl Tue Apr 10 15:29:28 2012 (r234101) @@ -122,7 +122,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This + * into a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) @@ -143,12 +143,12 @@ extern FILE *yyin, *yyout; /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + yy_c_buf_p = yy_cp = yy_bp + (n) - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) +#define unput(c) yyunput( (c), yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want