From owner-freebsd-bugs@FreeBSD.ORG Sat Mar 15 18:39:34 2008 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDDC1106566B; Sat, 15 Mar 2008 18:39:34 +0000 (UTC) (envelope-from dan@obluda.cz) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [78.128.192.10]) by mx1.freebsd.org (Postfix) with ESMTP id 685A28FC1C; Sat, 15 Mar 2008 18:39:33 +0000 (UTC) (envelope-from dan@obluda.cz) X-Envelope-From: dan@obluda.cz Received: from kgw.obluda.cz (openvpn.ms.mff.cuni.cz [195.113.20.87]) by smtp1.kolej.mff.cuni.cz (8.14.2/8.14.2) with ESMTP id m2FIdHd9063327; Sat, 15 Mar 2008 19:39:18 +0100 (CET) (envelope-from dan@obluda.cz) Message-ID: <47DC17D5.7090001@obluda.cz> Date: Sat, 15 Mar 2008 19:39:17 +0100 From: Dan Lukes User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.12) Gecko/20080302 SeaMonkey/1.1.8 MIME-Version: 1.0 To: Bruce Evans References: <200803150200.m2F206rl078586@freefall.freebsd.org> <20080315151246.L35251@besplex.bde.org> <47DB7DA8.7050400@obluda.cz> <20080315192732.A38703@delplex.bde.org> <47DBC810.3030903@obluda.cz> <20080316035724.V40050@delplex.bde.org> In-Reply-To: <20080316035724.V40050@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bugs@freebsd.org, imp@freebsd.org Subject: Re: bin/71613: [PATCH] traceroute(8): cleanup of the usr.sbin/traceroute6 code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2008 18:39:34 -0000 Bruce Evans napsal/wrote, On 03/15/08 18:12: > __COPYRIGHT() in reduces this problem by concatenating > __LINE__. It could also concatenate a file name (but not __FILE__, since > that is probably not an identifier). It's heuristic. It may, or may not work (it may or may not create unique name across all sources). >> We still have the problem the variable may be optimized out. > > __used prevents this. __used is nonstandard gcc extension. I tried it on gcc 3.4.6 and 4.2.3. It works. I don't know if it work for icc as I have no one. If it works, then it's good fix. > volatile doesn't prevent the variable being optimized out for gcc-4.2. > This makes some sense -- volatile sort of means "use it carefully", but > when it is not used no care with it is needed. The meaning of volatile shall be "use it carefully, because you can't found which way the variable is used". If the gcc-4.2 optimized it out, it's definitely gcc's bug. If I claim "you don't know how it's used" the compiler shall never respond "I better know what I know than you". But such discussion doesn't belong there. > I prefer 'static char const __used copyright[]'. Not sure where __used > belongs. I have no problem with it if __used works for all relevant compilers. I prefer the form of a macro (may be other than __COPYRIGHT) for further maintenance, but no problem even with non-macro form. ------------- Well, it seems we reach consensus. So what about commitment of a patch for this four year old PR ? ;-) Dan