Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rutgers!rochester!bbn.com!nic!kira!emily!wollman From: wollman@emily.uvm.edu (Garrett Wollman) Newsgroups: comp.lang.c Subject: Re: Embedding macro values in strings Message-ID: <1991Jan13.000941.23438@uvm.edu> Date: 13 Jan 91 00:09:41 GMT References: <1991Jan10.200806.12745@grep.co.uk> <10504@hydra.Helsinki.FI> Sender: news@uvm.edu Organization: University of Vermont - EMBA Computing Facility Lines: 19 Raymond-Protection: enabled Doug Gwyn will probably yell at me... #define foo_bar(baz) "Line " #baz #define foo() foo_bar(__LINE__) I *think* that this will work; I can't remember the exact order of application here, which was posted by one of the net.c.gurus a while back. It will work if the preprocessor expands __LINE__ before it expands foo_bar(). [I.e., is the C preprocessor a lazy or non-lazy evaluator?] Someone might have quotations from the relevant sections of the Standard? -GAWollman Garrett A. Wollman - wollman@emily.uvm.edu Disclaimer: I'm not even sure this represents *my* opinion, never mind UVM's, EMBA's, EMBA-CF's, or indeed anyone else's.