Undelivered mail

MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU
Sun Mar 13 06:48:08 AEST 1988


Subject:  Re: CPP defines...

[Non-Deliverable:  User does not exist or has never logged on]

Reply-To: Info-C at BRL.ARPA

Received: From UWAVM(MAILER) by ALASKA with Jnet id 8297
          for SXJVK at 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 at BRL.ARPA
Sender:       Info-C List <INFO-C at NDSUVM1>
From:         Nick Crossley <nick at ccicpg.uucp>
Subject:      Re: CPP defines...
Comments: To: info-c at brl-smoke.arpa
To:           Vic Kapella <SXJVK at ALASKA>

In article <179 at istop.ist.CO.UK> rb at 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 <options as required> /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



More information about the Comp.lang.c mailing list