Path: chuka.playstation.co.uk!news From: "Martin Day" Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Optimise Problem - trunced data Date: 29 Jul 1997 17:19:19 GMT Organization: SN Systems Ltd Lines: 28 Message-ID: <01bc9c44$3fe961e0$ca2c9ac2@martin.snsys.com> References: <333d7fd9.23907964@news.playstation.co.uk> <33424023.72C4@interactive.sony.com> <33D5B732.3AC9@dial.pipex.com> Reply-To: "Martin Day" NNTP-Posting-Host: martin.snsys.com X-Newsreader: Microsoft Internet News 4.70.1162 Chris Chadwick wrote in article <33D5B732.3AC9@dial.pipex.com>... > ... > > Is there no way around this problem? Does this mean we can't use > optimization with any code that uses any of the libps global > variables? If so this basically means none of the globals can be > used because everyone is going to want their stuff to run as fast > as possible by using optimization (I know I do!) > > What a bummer :( especially when everythings OK > when using the -O0 switch... wee-urd! One possible way round this would be to set up pointers to all the variables from libps you want to use and then only access them through these pointers rather than directly. e.g. in libps.h there's a line extern int math_errno; You could declare int *pmath_errno = &math_errno; in your program and then access it as *pmath_errno in your code. -- Martin martin@snsys.com +44 117 929 9733