From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15309 invoked by alias); 18 Feb 2002 21:26:04 -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 15266 invoked by uid 71); 18 Feb 2002 21:26:02 -0000 Resent-Date: 18 Feb 2002 21:26:01 -0000 Resent-Message-ID: <20020218212601.15256.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, mec@shout.net Received:(qmail 12872 invoked by uid 61); 18 Feb 2002 21:21:55 -0000 Message-Id:<20020218212155.12869.qmail@sources.redhat.com> Date: Mon, 18 Feb 2002 13:26:00 -0000 From: mec@shout.net Reply-To: mec@shout.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/5725: "no return statement in function returning non-void" on legal pthread style code X-SW-Source: 2002-02/txt/msg00440.txt.bz2 List-Id: >Number: 5725 >Category: c >Synopsis: "no return statement in function returning non-void" on legal pthread style code >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Feb 18 13:26:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: mec@shout.net >Release: gcc HEAD 20020216 >Organization: >Environment: red hat linux 7.2 native i686-pc-linux-gnulibc2.2 >Description: % cat return-bug.c void * philosopher (void *); void * philosopher (void * data) { int * counter = (int *) data; for (;;) ++*counter; } % gcc -c return-bug.c return-bug.c: In function 'philosopher': return-bug.c:9: warning: no return statement in function returning non-void % gcc -v Reading specs from /berman/fsf/_today_/berman/native/install/gcc/HEAD/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs Configured with: /berman/fsf/_today_/source/gcc/HEAD/configure --prefix=/berman/fsf/_today_/berman/native/install/gcc/HEAD --disable-shared --with-gnu-as --with-as=/berman/fsf/_today_/berman/native/install/binutils/HEAD/bin/as --with-gnu-ld --with-ld=/berman/fsf/_today_/berman/native/install/binutils/HEAD/bin/ld Thread model: single gcc version 3.1 20020216 (experimental) See also: http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00034.html This pattern of code occurs often in pthread code. The return type of the thread function is "void *" but there's often no need for the thread function to return. >How-To-Repeat: Compile the given program. >Fix: >Release-Note: >Audit-Trail: >Unformatted: