| delorie.com/archives/browse.cgi | search |
| From: | Jack Klein <jackklein AT spamcop DOT net> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: What does this mean? |
| Message-ID: | <8tp39t85bmn2vgtjvameuad3eb7l36s7f7@4ax.com> |
| References: | <4Ykk6.112438$p8 DOT 27106058 AT typhoon DOT southeast DOT rr DOT com> |
| X-Newsreader: | Forte Agent 1.8/32.548 |
| MIME-Version: | 1.0 |
| Lines: | 26 |
| Date: | Tue, 20 Feb 2001 03:41:40 GMT |
| NNTP-Posting-Host: | 12.75.152.9 |
| X-Complaints-To: | abuse AT worldnet DOT att DOT net |
| X-Trace: | bgtnsc07-news.ops.worldnet.att.net 982640500 12.75.152.9 (Tue, 20 Feb 2001 03:41:40 GMT) |
| NNTP-Posting-Date: | Tue, 20 Feb 2001 03:41:40 GMT |
| Organization: | AT&T Worldnet |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
On Tue, 20 Feb 2001 02:50:40 GMT, "pwillard" <pwillard AT mindspring DOT com>
wrote in comp.os.msdos.djgpp:
> I have a warning that says: "control reaches end of non-void function". What
> would be some reasons I would get this?
You SHOULD post the code of the function that causes the message. But
consider:
int compare(int a, int b)
{
if (a < b)
return -1;
else if (a > b)
return 1;
}
There are three return points in this function, the two return
statements and the "}" that ends the function. Depending on the
values passed to the function when it is called, it might return -1,
it might return 1, or it might hit the "}" and return ??? That final
possibility will happen if a and b are equal.
--
Jack Klein
Home: http://JK-Technology.Com
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |