public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7616: New warning request
@ 2002-08-16 14:56 Sylvain Pion
  0 siblings, 0 replies; 5+ messages in thread
From: Sylvain Pion @ 2002-08-16 14:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/7616; it has been noted by GNATS.

From: Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: Sylvain.Pion@sophia.inria.fr, gcc-gnats@gcc.gnu.org
Subject: Re: c++/7616: New warning request
Date: Fri, 16 Aug 2002 23:01:26 +0200

 On Fri, Aug 16, 2002 at 04:41:54PM -0400, Andrew Pinski wrote:
 > gcc does warn in a slightly different case with `-W -Wall':
 > struct A
 > {
 >    int i;
 >    void f(int i) const;
 > };
 > 
 > void A::f(int i) const
 > {
 > 
 > }
 > 
 > It is a know problem with gcc and inlined functions.
 
 I'm not talking about the "unused argument" warning.
 Sorry if I was not clear.
 
 What I would like is a new warning that tells me that I'm hiding the data
 member's name with the member function's argument name.
 
 The updated code below shows a situation where I would like a warning
 (and SunPRO emits one) :
 
 struct A
 {
   int i;
   void f(int i) const;
 };
 
 void A::f(int i) const
 {
   (void) i; // I use i somehow, but did I meant A::i or the argument i ???
 }
 
 -- 
 Sylvain


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7616: New warning request
@ 2002-08-17  1:56 gdr
  0 siblings, 0 replies; 5+ messages in thread
From: gdr @ 2002-08-17  1:56 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, nobody

Synopsis: New warning request

State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Sat Aug 17 01:37:43 2002
State-Changed-Why:
    As per submitter request

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7616


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7616: New warning request
@ 2002-08-16 18:16 Sylvain Pion
  0 siblings, 0 replies; 5+ messages in thread
From: Sylvain Pion @ 2002-08-16 18:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/7616; it has been noted by GNATS.

From: Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
To: Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
Cc: Andrew Pinski <pinskia@physics.uc.edu>, gcc-gnats@gcc.gnu.org,
   gcc-bugs@gcc.gnu.org
Subject: Re: c++/7616: New warning request
Date: Sat, 17 Aug 2002 01:40:13 +0200

 The warning is already implemented as -Wshadow, and I missed it in the
 manual...
 
 The PR can be closed.
 
 Sorry for the noise.
 
 -- 
 Sylvain


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7616: New warning request
@ 2002-08-16 14:06 Andrew Pinski
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Pinski @ 2002-08-16 14:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/7616; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: Sylvain.Pion@sophia.inria.fr
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7616: New warning request
Date: Fri, 16 Aug 2002 16:41:54 -0400

 gcc does warn in a slightly different case with `-W -Wall':
 struct A
 {
    int i;
    void f(int i) const;
 };
 
 void A::f(int i) const
 {
 
 }
 
 It is a know problem with gcc and inlined functions.
 
 Thanks,
 Andrew Pinski
 
 
 On Friday, August 16, 2002, at 04:27 , 
 Sylvain.Pion@sophia.inria.fr wrote:
 
 > struct A
 > {
 >   int i;
 >   void f(int i) const {}
 > };
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* c++/7616: New warning request
@ 2002-08-16 13:46 Sylvain.Pion
  0 siblings, 0 replies; 5+ messages in thread
From: Sylvain.Pion @ 2002-08-16 13:46 UTC (permalink / raw)
  To: gcc-gnats; +Cc: Sylvain.Pion


>Number:         7616
>Category:       c++
>Synopsis:       New warning request
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 16 13:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sylvain Pion
>Release:        3.3
>Organization:
>Environment:
Reading specs from ./gcc/Linux_trunc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: /u/zosma/0/prisme/spion/gcc/gcc_trunc/configure --disable-shared --disable-nls --enable-languages=c++ --prefix=/u/zosma/0/prisme/spion/gcc/Linux_trunc --with-gnu-as --with-gnu-ld --with-as=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/as --with-ld=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/ld
Thread model: posix
gcc version 3.3 20020813 (experimental)
>Description:
Compiling the code below with the SunPRO compiler gives the following warning :

"warning_request.cpp", line 6: Warning: i hides A::i.
1 Warning(s) detected.

G++ doesn't warn for this case, i.e. when the name of an argument of a member function hides a data member.
I think it would be nice to support it.
>How-To-Repeat:
struct A
{
  int i;
  void f(int i) const {}
};
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-08-17  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-16 14:56 c++/7616: New warning request Sylvain Pion
  -- strict thread matches above, loose matches on Subject: below --
2002-08-17  1:56 gdr
2002-08-16 18:16 Sylvain Pion
2002-08-16 14:06 Andrew Pinski
2002-08-16 13:46 Sylvain.Pion

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).