From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3286 invoked by alias); 5 Feb 2002 17:33:44 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 3184 invoked from network); 5 Feb 2002 17:33:38 -0000 Received: from unknown (HELO ariane.ens-cachan.fr) (138.231.176.4) by sources.redhat.com with SMTP; 5 Feb 2002 17:33:38 -0000 Received: from mayo.cmla.ens-cachan.fr (mayo.cmla.ens-cachan.fr [138.231.64.2]) by ariane.ens-cachan.fr (8.12.0.Beta19/jtpda-5.3.3) with ESMTP id g15HXWqh032209 ; Tue, 5 Feb 2002 18:33:32 +0100 Received: from jambon.cmla.ens-cachan.fr (jambon.cmla.ens-cachan.fr [138.231.64.60]) by mayo.cmla.ens-cachan.fr (8.9.1a/jtpda-5.3.2) with ESMTP id SAA02206 ; Tue, 5 Feb 2002 18:33:28 +0100 (MET) Received: from (dosreis@localhost) by jambon.cmla.ens-cachan.fr (8.9.3/jtpda-5.3.1/CL) id SAA28539 ; Tue, 5 Feb 2002 18:33:29 +0100 (MET) To: Bernard Dautrevaux Cc: "'Gabriel Dos Reis'" , dewar@gnat.com, aoliva@redhat.com, coola@ngs.ru, gcc@gcc.gnu.org, pcarlini@unitus.it Subject: Re: a warning to implement References: <17B78BDF120BD411B70100500422FC6309E45C@IIS000> From: Gabriel Dos Reis In-Reply-To: Bernard Dautrevaux's message of "Tue, 5 Feb 2002 17:35:59 +0100" Organization: CodeSourcery, LLC Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Tue, 05 Feb 2002 09:44:00 -0000 Message-ID: X-Mailer: Gnus v5.6.45/Emacs 19.34 X-SW-Source: 2002-02/txt/msg00262.txt.bz2 Bernard Dautrevaux writes: | > -----Original Message----- | > From: Gabriel Dos Reis [mailto:gdr@codesourcery.com] | > Sent: Tuesday, February 05, 2002 5:21 PM | > To: dewar@gnat.com | > Cc: gdr@codesourcery.com; aoliva@redhat.com; coola@ngs.ru; | > gcc@gcc.gnu.org; pcarlini@unitus.it | > Subject: Re: a warning to implement | > | > | > dewar@gnat.com (Robert Dewar) writes: | > | > | < whether it | > | should be valid statement; the issue was whether it could | > be a useful | > | construct -- incidentally some wanted to make it ill-formed. | > | >> | > | | > | Sorry, I can't imagine any useful use of this construct | > | > That *you* can't imagine a useful use of that construct doesn't mean | > other people don't. Other people do imagine, in the same way people | > have uses of SNaNs. | | There's a little difference here: SNaNs have a definite behaviour, Since you're arguing from a language standard point of view, SNaNs don't have definite behaviour, therefore I don't buy your statement: | which is | different from NaNs; however, from a language point of view, "int x = x;" is | exactly equivalent to "int x;" and really different from "int x = x0;". Firstly, certainly the warning won't be restricted to int. I think it will be implemented for every object type T. Now it you condiser the construct T x = x; then it is not equivalent to T x; Now, even in the case of fundamental interger type T, since the value of x is an inderterminate, that construct can be used to give an explicit hint to the compiler to handle « x » in special way -- e.g. it may have a trap representation if used in a context where there were no intervening assignment which changed x's value in a definite way. Pretty much, in the same of SNaNs. Please, note that I'm not saying that GCC should not have an option to trigger the proposed warning. I'm saying that that shouldn't be on by default in -Wall. [...] | ALL these constructs are perfectly valid, I'll repeat it one more time: I'm not agruing the validity of the construct. -- Gaby