public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
@ 2002-09-28  8:36 Gabriel Dos Reis
  0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Dos Reis @ 2002-09-28  8:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: austern@apple.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
Date: 28 Sep 2002 17:25:07 +0200

 austern@apple.com writes:
 
 [...]
 
 | bash-2.05$ ~/root/bin/g++ -Wmissing-declarations -c foo.c
 | cc1plus: warning: "-Wmissing-declarations" is valid for C/ObjC but not for C++
 | 
 | Either the documentation or the compiler is wrong.  Which is it?  (I suspect the documentation.)
 
 You suspect right:  The documentation should describe that option as
 being non C++; I see no way in which that switch could be helpful in C++.
 
 -- Gaby


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

* Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
@ 2003-05-15  5:42 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-05-15  5:42 UTC (permalink / raw)
  To: austern, gcc-bugs, gcc-prs, nobody

Synopsis: -Wmissing-declarations is C-only, conflicts with documentation

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Thu May 15 05:42:13 2003
State-Changed-Why:
    The C-only part has been fixed. Matt, I agree with Gaby that
    the -Wmissing-declarations is not very useful, since, for 
    example, most of the STL is implemented in header files (using
    inline functions) that have no prior declaration.
    
    Regarding the other issue (misdeclaration): there's not
    much you can do in C++, because you can overload. So if
    a declaration doesn't match a definition or another
    declaration for the same name, that's not an error, but
    just declares a second function. There may be something
    that I don't see, but I think I would prefer if we had
    a separate bug report for this if you feel that there's
    something missing.
    
    Thanks
      Wolfgang

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


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

* Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
@ 2002-10-15  4:36 Gabriel Dos Reis
  0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Dos Reis @ 2002-10-15  4:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Matt Austern <austern@apple.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
Date: 15 Oct 2002 13:27:42 +0200

 Matt Austern <austern@apple.com> writes:
 
 | I understand that the documentation is going to be changed to say
 | that this is a C-only option.  I suggest, however, that changing the
 | documentation doesn't mean we should close this bug; rather, it
 | means we should reclassify this from a bug to a feature request.
 
 OK, I'll reclassify it.
 
 | Seems to me that this warning is still useful for C++.  Arguably
 | more useful than in C: in C you'll get an error message from
 |    void foo(signed char);
 |    void foo(unsigned char x) { }
 | but in C++ it's legal.  It would be nice to have a switch that
 | gave a warning when you make a mistake like that.
 
 Well, I'm not sure we wanted a -Wpossibly-misoverloading (which may
 include overloads that are not overrinding) than a
 -Wmissing-declarations.  It is /typical/ in C++ to define a "global"
 (mor accurately a nemspace-scope) function with no preceding
 declaration.  The -Wmissing-declarations is much about detecting
 "auto-prototyping" function use than detecting mis-overloading.
 
 I would suggest we keep separate these two separate issues.
 
 -- Gaby


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

* Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
@ 2002-10-14 15:16 Matt Austern
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Austern @ 2002-10-14 15:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Matt Austern <austern@apple.com>
To: gcc-gnats@gcc.gnu.org
Cc: Gabriel Dos Reis <gdr@integrable-solutions.net>
Subject: Re: c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
Date: Mon, 14 Oct 2002 15:17:27 -0700

 I understand that the documentation is going to be changed to say
 that this is a C-only option.  I suggest, however, that changing the
 documentation doesn't mean we should close this bug; rather, it
 means we should reclassify this from a bug to a feature request.
 
 Seems to me that this warning is still useful for C++.  Arguably
 more useful than in C: in C you'll get an error message from
    void foo(signed char);
    void foo(unsigned char x) { }
 but in C++ it's legal.  It would be nice to have a switch that
 gave a warning when you make a mistake like that.
 
 			--Matt
 


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

* c++/8076: -Wmissing-declarations is C-only, conflicts with documentation
@ 2002-09-27 16:46 austern
  0 siblings, 0 replies; 5+ messages in thread
From: austern @ 2002-09-27 16:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8076
>Category:       c++
>Synopsis:       -Wmissing-declarations is C-only, conflicts with documentation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 27 16:46:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     austern@apple.com
>Release:        3.3 TOT
>Organization:
>Environment:

>Description:
The compiler documentation doesn't describe -Wmissing-declarations as a C-only option, but the compiler treats it as one:
bash-2.05$ cat foo.c
int f(int n) { return n; }
bash-2.05$ ~/root/bin/gcc -Wmissing-declarations -c foo.c
foo.c:1: warning: no previous declaration for `f'
bash-2.05$ ~/root/bin/g++ -Wmissing-declarations -c foo.c
cc1plus: warning: "-Wmissing-declarations" is valid for C/ObjC but not for C++

Either the documentation or the compiler is wrong.  Which is it?  (I suspect the documentation.)
>How-To-Repeat:

>Fix:

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


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

end of thread, other threads:[~2003-05-15  5:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-28  8:36 c++/8076: -Wmissing-declarations is C-only, conflicts with documentation Gabriel Dos Reis
  -- strict thread matches above, loose matches on Subject: below --
2003-05-15  5:42 bangerth
2002-10-15  4:36 Gabriel Dos Reis
2002-10-14 15:16 Matt Austern
2002-09-27 16:46 austern

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).