public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: mec@shout.net
To: gcc-gnats@gcc.gnu.org
Subject: c/5725: "no return statement in function returning non-void" on legal pthread style code
Date: Mon, 18 Feb 2002 13:26:00 -0000	[thread overview]
Message-ID: <20020218212155.12869.qmail@sources.redhat.com> (raw)


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


             reply	other threads:[~2002-02-18 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-18 13:26 mec [this message]
2002-04-23  2:06 rth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020218212155.12869.qmail@sources.redhat.com \
    --to=mec@shout.net \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).