delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/22/16:38:08

From: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie question (error that needs cc1plus.exe file)
Date: Thu, 22 May 1997 12:50:28 +0200
Organization: TU Chemnitz-Zwickau
Lines: 27
Message-ID: <338424F4.16C75C15@Mathematik.tu-chemnitz.de>
References: <97May21.104845gmt+0100 DOT 16661 AT internet01 DOT amc DOT de> <5m0hjp$ln5 AT freenet-news DOT carleton DOT ca>
NNTP-Posting-Host: pandora.hrz.tu-chemnitz.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Paul Derbyshire wrote:
> 
> or if it has no return statement (such as return 0). This is actually
> irritating sometimes when I have actually designed it so that main calls a
> function like cleanup() that has an exit in it. :)

Then you have to tell gcc, that your 'cleanup()' does not return:

static void __attribute__ ((noreturn))
cleanup()
{
  exit(0);
}

int main()
{
  cleanup();
}

Robert
-- 
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019