From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6977 invoked by alias); 25 Jan 2003 06:53:49 -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 6970 invoked from network); 25 Jan 2003 06:53:49 -0000 Received: from unknown (HELO mailout11.sul.t-online.com) (194.25.134.85) by 172.16.49.205 with SMTP; 25 Jan 2003 06:53:49 -0000 Received: from fwd10.sul.t-online.de by mailout11.sul.t-online.com with smtp id 18cK9G-0002Ck-02; Sat, 25 Jan 2003 07:50:38 +0100 Received: from juist (520046482682-0001@[80.131.88.42]) by fmrl10.sul.t-online.com with esmtp id 18cK97-02GEwSC; Sat, 25 Jan 2003 07:50:29 +0100 Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 18cK92-0003hh-00; Sat, 25 Jan 2003 07:50:24 +0100 To: Matt Austern Cc: Mark Mitchell , Stan Shebs , DJ Delorie , "gcc@gcc.gnu.org" Subject: Re: RFC: Named warnings References: From: Falk Hueffner Date: Sat, 25 Jan 2003 14:00:00 -0000 In-Reply-To: Message-ID: <87ptqliuz3.fsf@student.uni-tuebingen.de> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (broccoli) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender: 520046482682-0001@t-dialin.net X-SW-Source: 2003-01/txt/msg01209.txt.bz2 Matt Austern writes: > What do we know about prior art for other compilers? At the risk of > stating the obvious, providing pragmas and command line options to > get fine-grain control over warnings is not a new idea. The Compaq compiler, which is EDG based IIRC, has named warnings; a warning looks like this: cc: Info: test.c, line 1: The declaration of the function f has an empty parameter list. If the function has parameters, they should be declared here; if it has no parameters, "void" should be specified in the parameter list. (noparmlist) int f() { int x[10]; return x[10]; } ----^ cc: Info: test.c, line 1: In this statement, an array is being accessed outside the bounds specified for the array type. (subscrbounds) int f() { int x[10]; return x[10]; } -------------------------------^ cc: Warning: test.c, line 1: The storage at byte offset 40 from variable "x" is fetched but not initialized. Also the variable itself is not initialized. And there may be other fetches of this variable that have not been reported in this compilation. (uninit5) int f() { int x[10]; return x[10]; } -----------------------------^ You can set the level of each warning on the command line, or turn it off. "Info" level warnings are usually not shown. Warnings are also in groups, like "64bit", or "noc89", which can be enabled or disabled separately. It's a reasonable system, IMHO. -- Falk