Re: unused for all platforms
- From: Sander Vesik <sv117949 ireland sun com>
- To: Miroslaw Dobrzanski-Neumann <mne mosaic-ag com>
- Cc: GTKDEV <gtk-devel-list gnome org>
- Subject: Re: unused for all platforms
- Date: Mon, 18 Feb 2002 15:13:25 +0000 (GMT)
On Mon, 18 Feb 2002, Miroslaw Dobrzanski-Neumann wrote:
> On Mon, Feb 18, 2002 at 03:10:14PM +0100, Daniel Egger wrote:
> > Am Mon, 2002-02-18 um 09.49 schrieb Miroslaw Dobrzanski-Neumann:
> > > As I know there is no compiler that generates code for statements like
> > > "p = *&p"
> > Actually that would have to be "p = p" which is valid C and means
> > what it reads (i.e. Initialise p with the value it had before, whatever
> > that was; probably random).There was some hefty discussion on the gcc
> > mailinglist whether that really is the proper fix to prevent the
> > "variable blah might be used uninitialised" warnings and the only
> > conclusion they have reached was that it's totally valid C but should
> > be discouraged.
> p = *&p guarantees that p does not go into cpu register (its address is
No, it only gurantees that its not a "pure" register only variable. p=*&p
also probably refreshes the state of the in-register copy of the variable
from thew in-memory copy (in case someone went and overwrote it behind
What kind of optimisations it inhibits (after all, compilers with good
optimisations do a bit more flow analysis and don't make far
reaching assumptions just because an address of a variable was taken
somewhere) to make a compiler look at the computer as having m2m
operations is compiler (version) dependant.
> We use this construct as DO_NOT_CLOBBER(p) when using DCE exceptions.
> > Better would be to use the special attributes of gcc or pragmas of
> > other compilers to hint the compiler into the right direction. Of course
> > avoiding unused parameters would be the best idea after all.
> which ends in many #ifdef/#pragma parts which not necessary improve the
> readability of code.
> What about implementing exception handling in terms of setjmp/longjmp like DCE
> Miroslaw Dobrzanski-Neumann
> MOSAIC SOFTWARE AG
> Base Development and Research
> Tel +49-2225-882-291
> Fax +49-2225-882-201
> E-mail: mne mosaic-ag com
I see a dark sail on the horizon
Set under a dark cloud that hides the sun
Bring me my Broadsword and clear understanding
] [Thread Prev