ar, nm and drlink

Nick Burrett nick at dsvr.net
Fri Mar 1 07:57:11 PST 2002


Peter Naulls <peter at chocky.org> writes:

> In message <m3bse92ye1.fsf at nick.ws.noc.dsvr.net>
>           Nick Burrett <nick at dsvr.net> wrote:
> 
> > 
> > I have committed implementations of `ar' and `nm' which I found
> > sitting around on my hard disk from way back in 1999.
> > 
> > drlink was updated a couple of days ago to version 0.3.8, which
> > is a synchronisation between GCCSDK and Dave Daniels.
> 
> What follows is warning fixes for programs under riscos-aof, including
> the above.  The entirely of these fixes is unused functions/variables,
> undeclared functions and uninitialised variables.  The only exception,
> which I'd like a second opinon on is the bracketing in drlink - I'm
> pretty sure the & should really be &&.
> 

> Index: riscos-aof/drlink/areas.c
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/drlink/areas.c,v
> retrieving revision 1.1.2.2
> diff -u -r1.1.2.2 areas.c
> --- riscos-aof/drlink/areas.c	2002/02/26 07:35:33	1.1.2.2
> +++ riscos-aof/drlink/areas.c	2002/03/01 11:09:53
> @@ -1584,8 +1584,8 @@
>   * () to it
>   */
>    noheader = imagetype==RMOD 
> -   || imagetype==BIN &&
> -    (entryarea==rocodelist || (rodatalist==NIL && entryarea==rwcodelist)) && entryoffset==0
> +   || (imagetype==BIN &&
> +    (entryarea==rocodelist || (rodatalist==NIL && entryarea==rwcodelist)) && entryoffset==0)
>     || opt_codebase;
>  }
>  


I'm not convinced.  I found this version in an early version of the drlink
source tree:

  noheader = imagetype==RMOD
             || (imagetype==BIN && entryarea==rocodelist)
             || (rodatalist==NIL
                 && rwcodelist==entryarea
                 && entryoffset==0)
             || opt_codebase;

which is a little different to:

  noheader = imagetype==RMOD 
    || imagetype==BIN &&
     (entryarea==rocodelist || (rodatalist==NIL && entryarea==rwcodelist)) && entryoffset==0
    || opt_codebase;

and Pete's version:

  noheader = imagetype==RMOD
   || (imagetype==BIN &&
    (entryarea==rocodelist || (rodatalist==NIL && entryarea==rwcodelist)) && entryoffset==0)
   || opt_codebase;


I'm not really sure of the correct logic.


Thoughts ?


Nick.



More information about the gcc mailing list