Path: utzoo!mnetor!uunet!husc6!bbn!rochester!ritcv!cci632!ccicpg!nick From: nick@ccicpg.UUCP (Nick Crossley) Newsgroups: comp.lang.c Subject: Re: CPP defines... Message-ID: <14490@ccicpg.UUCP> Date: 10 Mar 88 23:38:46 GMT References: <14192@hc.DSPO.GOV> <179@istop.ist.CO.UK> Reply-To: nick@ccicpg.UUCP (Nick Crossley) Organization: CCI CPG, Irvine CA Lines: 26 Keywords: cpp,preprocessor,#define In article <179@istop.ist.CO.UK> rb@ist.CO.UK (News reading a/c for rb) writes: >Here's a nasty little script that comes in useful when you >want to know what your cpp *really* predefines: we have found >that the man page is sometimes economical with the truth. > ... >strings -a -2 /lib/cpp | sed '/^a-zA-Z0-9_/!s/.*/#ifdef &\ >"%&"\ >#endif/p' |/lib/cpp |sed -n '/%/s/[%"]//gp' Ah, but not all systems have their predefined symbols defined by cpp! I know of some which define some symbols in cc! Thus, a better? more complete? approach might be :- strings /lib/cpp /bin/cc | sort -u | sed -n '/^[a-zA-Z0-9_]*$/s//#ifdef &\ "%&"\ #endif/p' >cpp_test.c cc -E cpp_test.c | sed -n '/%/s/[%"]//gp' -- <<< standard disclaimers >>> Nick Crossley, CCI, 9801 Muirlands, Irvine, CA 92718-2521, USA Tel. (714) 458-7282, uucp: ...!uunet!ccicpg!nick