Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU From: MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU Newsgroups: comp.lang.c Subject: Undelivered mail Message-ID: <12317@brl-adm.ARPA> Date: 12 Mar 88 20:48:08 GMT Sender: news@brl-adm.ARPA Lines: 43 Subject: Re: CPP defines... [Non-Deliverable: User does not exist or has never logged on] Reply-To: Info-C@BRL.ARPA Received: From UWAVM(MAILER) by ALASKA with Jnet id 8297 for SXJVK@ALASKA; Sat, 12 Mar 88 11:29 AST Received: by UWAVM (Mailer X1.25) id 5578; Sat, 12 Mar 88 12:29:11 PST Date: Thu, 10 Mar 88 23:38:46 GMT Reply-To: Info-C@BRL.ARPA Sender: Info-C List From: Nick Crossley Subject: Re: CPP defines... Comments: To: info-c@brl-smoke.arpa To: Vic Kapella 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