From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15088 invoked by alias); 12 May 2014 18:57:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 15078 invoked by uid 89); 12 May 2014 18:57:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ee0-f45.google.com Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com) (74.125.83.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 12 May 2014 18:57:03 +0000 Received: by mail-ee0-f45.google.com with SMTP id d49so4986208eek.32 for ; Mon, 12 May 2014 11:56:59 -0700 (PDT) X-Received: by 10.15.54.6 with SMTP id s6mr34515943eew.4.1399921019841; Mon, 12 May 2014 11:56:59 -0700 (PDT) Received: from [192.168.178.2] (ppp005054052251.access.hol.gr. [5.54.52.251]) by mx.google.com with ESMTPSA id cb5sm34740169eeb.18.2014.05.12.11.56.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 11:56:58 -0700 (PDT) Message-ID: <53711978.7000404@gmail.com> Date: Mon, 12 May 2014 18:57:00 -0000 From: Dimitris Papavasiliou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130630 Icedove/17.0.7 MIME-Version: 1.0 To: Mike Stump CC: "gcc-patches@gcc.gnu.org Patches" Subject: Re: [PATCH] Add a couple of dialect and warning options regarding Objective-C instance variable scope References: <52F35508.4080205@gmail.com> <5486E33D-B8F6-473F-8F33-6A7DEECB45A8@comcast.net> <5359999C.7090607@gmail.com> <757BB622-2CA8-4C9A-BCA9-AAD1FDF8F14F@comcast.net> <535A8EA8.5040706@gmail.com> <80E7465A-6FE8-475D-873E-FF2F2C8EC2ED@comcast.net> <535E2EF9.3070500@gmail.com> <904A6DC5-2EFF-4C6A-9E2D-62DAB3045FBF@comcast.net> In-Reply-To: <904A6DC5-2EFF-4C6A-9E2D-62DAB3045FBF@comcast.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00846.txt.bz2 On 05/12/2014 07:24 PM, Mike Stump wrote: > On Apr 28, 2014, at 3:35 AM, Dimitris Papavasiliou wrote: >>>> + a = private; /* { dg-warning "hides instance variable" "" { xfail *-*-* } } */ >>>> + a = protected; /* { dg-warning "hides instance variable" "" { xfail *-*-* } } */ >>>> + a = public; /* { dg-warning "hides instance variable" "" { xfail *-*-* } } */ >>> >>> No, we don’t expect failures. We makes the compiler do what we wants or it gets the hose again. Then, we expect it to be perfect. If you won’t want warning, and non are produces, then just remove the /* … */, or write /* no warning */. >> >> I've fixed these as per your request. For the record though, this form of test seems to be fairly common in the test suites as this output indicates: >> >> dimitris@debian:~/sandbox/gcc-build$ find ../gcc-source/gcc/testsuite/ -name "*.c" -o -name "*.C" -o -name "*.m" | xargs grep "xfail \*-\*-\*" | wc -l >> 354 >> >> Many of these seem to be in error or warning messages which are expected not to show up. In any case if the messages do show up they'll trigger the excessive messages test so I suppose that's enough. > >>> Once we resolve the 3 warning tests above, this will be ok. >> >> Actually, there were a few more { xfail *-*-* } in the other test cases. I've removed these as well. > > So, let’s make sure we’re on the same page… > > Take shadow-2.m for example, before you said: > > + a = private; /* { dg-warning "hides instance variable" "" { xfail *-*-* } } */ > > and now you say: > > + a = private; /* No warning. */ > > So, the first question is, what do we _want_ in the end here? Warning or no warning? And what do we actually do now, warn or not? > > If in the end, we want a warning, then the previous form is the right eventually form. If we don’t want a warning, then the second is correct, though, there is another form that is not unreasonable: > > i += [Base class_func1]; /* { dg-bogus "invalid receiver type" } */ > > this says that we used to generate a warning (or an error message), but that was wrong, and we no longer want to expect a warning, and that the bug has been fixed and that no warning is generated. > > I think we are on the same page, just wanted to make sure... > Well the point of this test is to make sure that the introduced -Wshadow also controls the warnings related to the shadowing of instance variables which was not the case in the past. So we declare a couple of local variables of the same name and expect that they silently shadow the instance variables, that is that warnings are _not_ generated. So I take it that I should change these to dg-bogus since this is behavior expected in the past but not now, as well as any other expected non-warnings in the other test cases? Is it important in some way that dg-bogus makes no distinction between warning and error messages?