Source-Changes archive

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

Re: CVS commit: syssrc/sys/arch/pmax/pmax



On Apr 22,  6:29pm, Robert Elz wrote:
}     Date:        Fri, 30 Nov 2001 09:34:22 +0100
}     From:        Lennart Augustsson <lennart%augustsson.net@localhost>
} 
}   | > There's a number of places in the kernel where we assume that an
}   | > undefined flag == 0 in preprocessor expressions, some of them to test
}   | > if just one of the tokens is defined.  Is it actaully _abuse_ of the
}   | > preprocessor, or defined(!) behaviour?
}   | 
}   | Well, in the past it has always been abuse.
} 
} No it isn't
} 
}       #undef thing
} 
}       #if thing > 1
} 
} has always been interpreted as "#if 0 > 1"
} 
} I think K&R (2, #if didn't exist in K&R 1 I don't think) might have even
} said so, but my copy isn't here for me to check.

     I dug out my copy of K&R2.  In Section A12.5 (Conditional
Compilation) on page 232 it says, "Any identifiers remaining after
macro expansion are replaced by 0L."  So you are correct, it isn't
abuse.

}-- End of excerpt from Robert Elz



Home | Main Index | Thread Index | Old Index