public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/7860: few new suggested warnings
@ 2002-09-08 16:06 Andrew Pinski
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2002-09-08 16:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Andrew Pinski <pinskia@physics.uc.edu>
To: jhi@iki.fi
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7860: few new suggested warnings
Date: Sun, 8 Sep 2002 18:57:44 -0400

 Here is a copy of the file since the file was in macbinary format that 
 some people cannot decode:
 -Wcppcomment
 
          Warn about C++ style comments // like this.
 
 -Wgnuextensions
 
          Warn about the use of any GNU extensions.
 
 -Wpointer-implicit-sign
 
          Warn if a pointer is implicitly cast between signed
          and unsigned, for example:
 
              int foo(unsigned char *s) {
                  ...
              }
                  ...
                  char *s;
                  ...
                  foo(s);
 
          (enabled by -ansi)
 
 -Wenum-implicit-int
 
          Warn if enums are implicitly used as integers, for example
 
          enum e { E1, E2, E3 };
          ...
          enum e e1 = 0;  /* Warn. */
          enum e e2 = E2;
          enum e e3, e4;
          e3 = e1 + 1;    /* Warn. */
          e2++;           /* Warn. */
          e4 = e3 & ~E2;  /* Warn. */
 
 -Wenum-trailing-comma
 
          Warn if enum declaration has a trailing comma.
 
          (enabled by -pedantic)
 
 -Wcpp-spurious-tokens
 
          Warn if there are any unnecessary tokens after preprocessor 
 commands,
          for example
 
              #endif STUFF
 
          (enabled by -pedantic)
 


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

* Re: c/7860: few new suggested warnings
@ 2002-09-16  7:16 Jarkko Hietaniemi
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Hietaniemi @ 2002-09-16  7:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jarkko Hietaniemi <jhi@iki.fi>
To: jsm28@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   jsm28@cam.ac.uk, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/7860: few new suggested warnings
Date: Mon, 16 Sep 2002 17:08:55 +0300

 Also, since most of the suggested new warnings are about rather simple
 code portability glitches (like the // and the lvalue casts), adding
 as many of them as possible to be under the -Wall would be nice.
 Of course, this has to be balanced against people not liking their
 previously -Wall-happy code starting to whine...
 
 -- 
 Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special
 biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen


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

* Re: c/7860: few new suggested warnings
@ 2002-09-15 13:35 jsm28
  0 siblings, 0 replies; 6+ messages in thread
From: jsm28 @ 2002-09-15 13:35 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jhi, jsm28, nobody

Synopsis: few new suggested warnings

State-Changed-From-To: open->analyzed
State-Changed-By: jsm28
State-Changed-When: Sun Sep 15 13:35:12 2002
State-Changed-Why:
    Of those mentioned, -Wgnuextensions already exists as
    -pedantic and -Wcpp-spurious-tokens already exists as
    -Wendif-labels (on by default).  The others may be useful
    to add.

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


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

* Re: c/7860: few new suggested warnings
@ 2002-09-15  8:26 Jarkko Hietaniemi
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Hietaniemi @ 2002-09-15  8:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jarkko Hietaniemi <jhi@iki.fi>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/7860: few new suggested warnings
Date: Sun, 15 Sep 2002 18:22:53 +0300

 I just remembered one more warning that would be useful to have
 available on its own, outside of -pedantic:
 
 -Wcast-lvalue
 
 	Warn if a cast expression is used as an lvalue.
 
 -- 
 Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special
 biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen


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

* Re: c/7860: few new suggested warnings
@ 2002-09-08 16:06 Jarkko Hietaniemi
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Hietaniemi @ 2002-09-08 16:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jarkko Hietaniemi <jhi@iki.fi>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7860: few new suggested warnings
Date: Mon, 9 Sep 2002 01:59:57 +0300

 > Here is a copy of the file since the file was in macbinary format that 
 > some people cannot decode:
 
 Oops, sorry about that.  I blame the browser (yes, I'm a on Mac).
 
 -- 
 Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special
 biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen


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

* c/7860: few new suggested warnings
@ 2002-09-08 15:06 jhi
  0 siblings, 0 replies; 6+ messages in thread
From: jhi @ 2002-09-08 15:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7860
>Category:       c
>Synopsis:       few new suggested warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 08 15:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jarkko hietaniemi
>Release:        any
>Organization:
>Environment:
any
>Description:
I was the release manager of the Perl 5.8.0 project.  As a part of that, we did a lot of test building on many platforms to clean up the C source code of Perl, and saw a lot of warnings about dubious practices that gcc didn't catch.

Therefore, I would like to suggest adding these warnings to some upcoming gcc release. 

Some of the suggested warnings are already there but one needs either -ansi or -pedantic to enable them, and in some projects (including Perl) this is not an option, therefore having the warnings still available separately would be a good thing.  (In general, maybe "disassembling" -ansi and -pedantic into separate options would be beneficial?)

Some of the suggested warnings do not seem to be there and therefore they would be completely new.

The suggested warnings are in the file attachment.
>How-To-Repeat:

>Fix:
Implement the new warnings :-)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-macbinary; name="gccneedwarn"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gccneedwarn"

AAtnY2NuZWVkd2FybgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQpAAAAALmhQPS5oUD0AAAAbUJJTgAAAAAAAAAA
AAAAAAAAAACCgYstAAAtV2NwcGNvbW1lbnQKCiAgICAgICAgV2FybiBhYm91dCBDKysgc3R5bGUg
Y29tbWVudHMgLy8gbGlrZSB0aGlzLgoKLVdnbnVleHRlbnNpb25zCgogICAgICAgIFdhcm4gYWJv
dXQgdGhlIHVzZSBvZiBhbnkgR05VIGV4dGVuc2lvbnMuCgotV3BvaW50ZXItaW1wbGljaXQtc2ln
bgoKICAgICAgICBXYXJuIGlmIGEgcG9pbnRlciBpcyBpbXBsaWNpdGx5IGNhc3QgYmV0d2VlbiBz
aWduZWQKICAgICAgICBhbmQgdW5zaWduZWQsIGZvciBleGFtcGxlOgoKICAgICAgICAgICAgaW50
IGZvbyh1bnNpZ25lZCBjaGFyICpzKSB7CiAgICAgICAgICAgICAgICAuLi4KICAgICAgICAgICAg
fQogICAgICAgICAgICAgICAgLi4uCiAgICAgICAgICAgICAgICBjaGFyICpzOwogICAgICAgICAg
ICAgICAgLi4uCiAgICAgICAgICAgICAgICBmb28ocyk7CgogICAgICAgIChlbmFibGVkIGJ5IC1h
bnNpKQoKLVdlbnVtLWltcGxpY2l0LWludAoKICAgICAgICBXYXJuIGlmIGVudW1zIGFyZSBpbXBs
aWNpdGx5IHVzZWQgYXMgaW50ZWdlcnMsIGZvciBleGFtcGxlCgogICAgICAgIGVudW0gZSB7IEUx
LCBFMiwgRTMgfTsKICAgICAgICAuLi4KICAgICAgICBlbnVtIGUgZTEgPSAwOyAgLyogV2Fybi4g
Ki8gCiAgICAgICAgZW51bSBlIGUyID0gRTI7CiAgICAgICAgZW51bSBlIGUzLCBlNDsKICAgICAg
ICBlMyA9IGUxICsgMTsgICAgLyogV2Fybi4gKi8KICAgICAgICBlMisrOyAgICAgICAgICAgLyog
V2Fybi4gKi8KICAgICAgICBlNCA9IGUzICYgfkUyOyAgLyogV2Fybi4gKi8gCgotV2VudW0tdHJh
aWxpbmctY29tbWEKCiAgICAgICAgV2FybiBpZiBlbnVtIGRlY2xhcmF0aW9uIGhhcyBhIHRyYWls
aW5nIGNvbW1hLgoKICAgICAgICAoZW5hYmxlZCBieSAtcGVkYW50aWMpCgotV2NwcC1zcHVyaW91
cy10b2tlbnMKCiAgICAgICAgV2FybiBpZiB0aGVyZSBhcmUgYW55IHVubmVjZXNzYXJ5IHRva2Vu
cyBhZnRlciBwcmVwcm9jZXNzb3IgY29tbWFuZHMsCiAgICAgICAgZm9yIGV4YW1wbGUKCiAgICAg
ICAgICAgICNlbmRpZiBTVFVGRgoKICAgICAgICAoZW5hYmxlZCBieSAtcGVkYW50aWMpCgoAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=


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

end of thread, other threads:[~2002-09-16 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-08 16:06 c/7860: few new suggested warnings Andrew Pinski
  -- strict thread matches above, loose matches on Subject: below --
2002-09-16  7:16 Jarkko Hietaniemi
2002-09-15 13:35 jsm28
2002-09-15  8:26 Jarkko Hietaniemi
2002-09-08 16:06 Jarkko Hietaniemi
2002-09-08 15:06 jhi

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