Re: a.out.h in text-utils/more.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 14 May 2008, Karel Zak wrote:
> On Tue, May 13, 2008 at 10:20:40AM -0400, Mike Frysinger wrote:
> > any problems with dropping the a.out.h include in text-utils/more.c and
> > replacing the three defines with the actual constants ?  the constants
> > are
>
>  Mike, you forgot to describe advantage of this change :-)

portability.  a.out.h is not POSIX and is a historical wart in today's ELF 
world.  it's also broken for libc's that were relying on the kernel's a.out.h 
but the kernel is no longer exporting it ... yes, this is a bug on the libc 
side of things, but if nothing depended on a.out.h in the first place ...

> > already in the source, and it isnt like these are ever going to change
> > ...
>
>  Doesn't make sense to use macros from header files rather than
>  hardcoded undocumented magic constants?

the constants are documented quite clearly in every spec out there.  if we 
were talking about structures, i'd lean much more towards relying on the 
header.  but we arent.  more.c uses the magic constants for a.out to detect 
the format.  using this logic, why arent we using the magic constants from 
elf.h ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux