From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12662 invoked by alias); 16 Nov 2002 10:06:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12641 invoked by uid 71); 16 Nov 2002 10:06:03 -0000 Resent-Date: 16 Nov 2002 10:06:03 -0000 Resent-Message-ID: <20021116100603.12639.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Andrew Suffield Resent-Reply-To: gcc-gnats@gcc.gnu.org, 153965@bugs.debian.org Received: (qmail 8376 invoked from network); 16 Nov 2002 09:59:30 -0000 Received: from unknown (HELO mail.cs.tu-berlin.de) (130.149.17.13) by sources.redhat.com with SMTP; 16 Nov 2002 09:59:30 -0000 Received: from smile.cs.tu-berlin.de (mail@smile.cs.tu-berlin.de [130.149.19.24]) by mail.cs.tu-berlin.de (8.9.3/8.9.3) with ESMTP id KAA07649; Sat, 16 Nov 2002 10:55:43 +0100 (MET) Received: from doko by smile.cs.tu-berlin.de with local (Exim 3.35 #1 (Debian)) id 18Czfz-0001gD-00; Sat, 16 Nov 2002 10:55:43 +0100 Message-Id: Date: Fri, 22 Nov 2002 07:42:00 -0000 From: Matthias Klose Reply-To: 153965@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org Cc: Phil Edwards X-Send-Pr-Version: 3.113 X-GNATS-Notify: Andrew Suffield Subject: preprocessor/8602: incorrect line numbers in warning messages when using inline functions X-SW-Source: 2002-11/txt/msg00822.txt.bz2 List-Id: >Number: 8602 >Category: preprocessor >Synopsis: incorrect line numbers in warning messages when using inline functions >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Nov 16 02:06:02 PST 2002 >Closed-Date: >Last-Modified: >Originator: Andrew Suffield >Release: 3.2.1 (Debian) (Debian unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: i686 host: i386-linux Configured with: /home/packages/gcc/3.2/gcc-3.2-3.2.1ds5/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: [ Reported to the Debian BTS as report #153965. Please CC 153965@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/153965 ] ----- static inline int foo(int x) { if (!x) return 0; } int main(void) { foo(1); return 1; } ----- $ gcc-2.95 -Wall -c !$ gcc-2.95 -Wall -c bug-153965.c bug-153965.c: In function `foo': bug-153965.c:6: warning: control reaches end of non-void function ^^^ $ gcc-3.2 -Wall -c bug-153965.c bug-153965.c: In function `foo': bug-153965.c:13: warning: control reaches end of non-void function ^^^^ $ gcc-3.3 -Wall -c bug-153965.c bug-153965.c: In function `foo': bug-153965.c:13: warning: control reaches end of non-void function ^^^^^ gcc 3.[23] also produces correct line numbers if either "static" or "inline" is removed from foo. Removing the body of function foo() causes a secondary warning to be generated in the right place, but the original warning still has the wrong line number. [gcc-3.2 is gcc-3.2.1 20021111, gcc-3.3 is HEAD 20021103] >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: