www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/15/17:45:48

Date: Sat, 16 Nov 1996 11:22:07 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Force call for function
To: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de>
Cc: ilya AT spy DOT isp DOT nsc DOT ru, djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <328DA3DF.33A9@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <328BC51C DOT 79C6 AT spy DOT isp DOT nsc DOT ru>
<328B3537 DOT 934 AT Mathematik DOT tu-chemnitz DOT de>

Robert Hoehne wrote:
> 
> Ilya P. Ryzhenkov wrote:
> >
> > Hello!
> >  I wonder if there is a way to force function call
> >  regardless of optimization level on a per function basis.
> I don't know if I'm correct, but I think for this is the keyword
> "volatile",
> that means for your example:
> 
> volatile int f() { return 1; }
> 
> Or use the harder trick, by putting the singel function in a separate
> source file.
> 
> Robert

Another way would be to call the functions through a function pointer. I
don't
think gcc optimizes those out.

bill
-- 
Leave others their otherness.

- Raw text -


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