From owner-freebsd-current@FreeBSD.ORG Thu Nov 15 23:09:24 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65C0C5EC; Thu, 15 Nov 2012 23:09:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8AF8FC14; Thu, 15 Nov 2012 23:09:24 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:548c:a8ca:65a3:1c17] (unknown [IPv6:2001:7b8:3a7:0:548c:a8ca:65a3:1c17]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 55D415C59; Fri, 16 Nov 2012 00:09:23 +0100 (CET) Message-ID: <50A57623.4020108@FreeBSD.org> Date: Fri, 16 Nov 2012 00:09:23 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: compiler info in kernel identification string References: <20121113234303.GA15319@dft-labs.eu> <50A3639C.9050200@FreeBSD.org> <1352907497.1217.147.camel@revolution.hippie.lan> In-Reply-To: <1352907497.1217.147.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mateusz Guzik , avg@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 23:09:24 -0000 On 2012-11-14 16:38, Ian Lepore wrote: > On Wed, 2012-11-14 at 10:25 +0100, Dimitry Andric wrote: ... >> That way, you are sure never to lose information. This also works for >> gcc from ports (which is the reason for the space after 'version' in the >> grep command): >> >> $ gcc47 -v 2>&1 | grep 'version ' >> gcc version 4.7.3 20120929 (prerelease) (FreeBSD Ports Collection) >> >> I realize this is a bit long, but it is better to have complete than >> stripped information. > > Rather than just taking whatever the compiler emits, the proposed patch > seems to be carefully crafted to avoid breaking existing 3rd party tools > which parse uname output based on the location of whitespace. I'm not > sure how important that is given that the uname manpage doesn't document > the output format as if it were somehow rigidly specified. I can see where you're coming from, but I also think it is very fragile to depend on parsing such information from uname. If you do so, you must be prepared to accept wonky input, otherwise, just don't do it. :) And as I remarked in another reply, now that I have thought about it a bit, I would much rather see this information moved to a sysctl or dmesg line, than in uname. With the happy side effect that no existing uname parsers would be confused!