From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 16 14:50:10 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED30E106564A for ; Mon, 16 Apr 2012 14:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C77AD8FC15 for ; Mon, 16 Apr 2012 14:50:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q3GEoAH4038061 for ; Mon, 16 Apr 2012 14:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q3GEoAVS038060; Mon, 16 Apr 2012 14:50:10 GMT (envelope-from gnats) Resent-Date: Mon, 16 Apr 2012 14:50:10 GMT Resent-Message-Id: <201204161450.q3GEoAVS038060@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, tg@gmplib.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 441AC1065672 for ; Mon, 16 Apr 2012 14:43:10 +0000 (UTC) (envelope-from tege@hehe.gmplib.org) Received: from hehe.gmplib.org (gmplib-00.nada.kth.se [130.237.222.240]) by mx1.freebsd.org (Postfix) with ESMTP id 00FA38FC0C for ; Mon, 16 Apr 2012 14:43:09 +0000 (UTC) Received: from hehe.gmplib.org (localhost [127.0.0.1]) by hehe.gmplib.org (Postfix) with ESMTP id A009F30D7B for ; Mon, 16 Apr 2012 16:35:41 +0200 (CEST) Received: (from tege@localhost) by hehe.gmplib.org (8.14.5/8.14.5/Submit) id q3GEZflL022237; Mon, 16 Apr 2012 16:35:41 +0200 (CEST) (envelope-from tege) Message-Id: <201204161435.q3GEZflL022237@hehe.gmplib.org> Date: Mon, 16 Apr 2012 16:35:41 +0200 (CEST) From: TG To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/166994: m4's eval function ignores documented 2nd and 3rd arguments X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tg@gmplib.org List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 14:50:11 -0000 >Number: 166994 >Category: bin >Synopsis: m4's eval function ignores documented 2nd and 3rd arguments >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 16 14:50:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: tege >Release: FreeBSD 9.0-RELEASE amd64 >Organization: KTH >Environment: System: FreeBSD hehe.gmplib.org 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The eval() function of /usr/bin/m4 seem to completely ignore the 2nd (radix) and 3rd (width) arguments. The man page documents these arguments, and other implementations of m4 handle them (Solaris, GNU). This leads to the conclusion that the BSD implementation of eval is broken in this respect. >How-To-Repeat: Execute from sh: echo 'eval(12245853,16,10)' | m4 FreeBSD 9.0 (as well as e.g. 8.1) incorrectly outputs "12245853". Expected output is "0000BADB5D". >Fix: I was about to fix it, but found that the license of the code in question was unacceptable to me. I only contribute to Free Software, not to Open Source code bearing a license analogous to a law system that permits people to sell themselves as slaves. ;-) >Release-Note: >Audit-Trail: >Unformatted: