public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/5725: "no return statement in function returning non-void" on legal pthread style code
@ 2002-04-23  2:06 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-23  2:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mec, nobody

Synopsis: "no return statement in function returning non-void" on legal pthread style code

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Apr 23 02:06:39 2002
State-Changed-Why:
    Fixed in current cvs, sortof.

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


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

* c/5725: "no return statement in function returning non-void" on legal pthread style code
@ 2002-02-18 13:26 mec
  0 siblings, 0 replies; 2+ messages in thread
From: mec @ 2002-02-18 13:26 UTC (permalink / raw)
  To: gcc-gnats


>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:


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

end of thread, other threads:[~2002-04-23  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-23  2:06 c/5725: "no return statement in function returning non-void" on legal pthread style code rth
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18 13:26 mec

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