PARAMS
Hi,
I've been looking at the QEMU source and I came across the PARAMS
macro in dis-asm.h. Why is this necessary? It looks to me like what's comes out of PARAMS() is what goes into it, so why even have it? Sorry if this is a dumb question, I searched the archives for it and didn't find anything.
Thanks,
David
David Holman <[email protected]> wrote:
: Hi,
: I've been looking at the QEMU source and I came across the PARAMS
: macro in dis-asm.h. Why is this necessary? It looks to me like what's : comes out of PARAMS() is what goes into it, so why even have it? Sorry : if this is a dumb question, I searched the archives for it and didn't : find anything.
dis-asm.h is from GNU binutils, which is supposed to work with really old compilers which doesn't support parameter prototypes. Therefor you define the PARAMS-macro; it expands to () for old compilers and to args for newer ones. That's also why a lot of the GNU code have K&R function heads. But I think they have started to move away from that (GDB has at least.)
Signature · 2 lines
Johan Rydberg, Free Software Developer, Sweden http://rtmk.sf.net | http://www.nongnu.org/guss/