[parisc-linux] Missing directories from CVS

LaMont Jones lamont@security.hp.com
Thu, 23 Sep 1999 12:58:52 -0600


> And on this one "cc" gets picky about pointer math.
> Here's my diff for mkImage.c:

> <     *entry_point = *(unsigned long*)(ptr + 6*sizeof(long));
> ---
> >     *entry_point = *(unsigned long*)((char *)ptr + 6*sizeof(long));
OK, so I'm too lazy to go look...  what type is ptr?  I'd guess that
it's declared void*, since that's the only way the pointer math could
work in gcc and not in HP-cc.

> Any objections to committing this change?
> On second thought, both changes should be written as:
> 	*entry_point = ((unsigned long *)ptr)[6];
> and	
> 	short magic = ((short *)ptr)[1];
How about just using filehdr.h, or copying struct header from it, and
using the real structure...?  (I think we've released the format enough
that we could clone the structure, failing that:

  struct header {
	unsigned short magic;
	short fill0;
	long fill[5];
	unsigned long entry_point;
  };
will fit the bill quite nicely.

LaMont "I hate magic offsets" Jones