Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!styx!nike!sri-spam!argv From: argv@sri-spam.ARPA (AAAARRRRGGGGv) Newsgroups: net.unix-wizards,net.lang.c Subject: Re: #define kinda stuff Message-ID: <5525@sri-spam.ARPA> Date: Fri, 11-Apr-86 02:35:22 EST Article-I.D.: sri-spam.5525 Posted: Fri Apr 11 02:35:22 1986 Date-Received: Sun, 13-Apr-86 07:23:19 EST References: <1458@cwruecmp.UUCP> <386@cit-vax.Caltech.Edu> Distribution: net Organization: SRI International, Menlo Park, CA Lines: 33 Xref: linus net.unix-wizards:14619 net.lang.c:7870 In article <1458@cwruecmp.UUCP> ryan@cwruecmp.UUCP (Ryan McGuire) writes: > Here's what I wanna do: > >#define (-: /* >#define :-) */ As we all know, this is not possible, however someone around here tried it and found a strange compiler error: "endif not found" Code was: #define \(-: "/*" #define :-\) "*/" (-: comment :-) main(){} Well, *I* thought it was a compiler error since there was no "if" for the preprocessor! Something a little more interesting, tho, is that the following code, submitted by someone learning C on the Sun: char foo[3][10] = { "one"; "two"; "three"; }; main() { printf("%s\n", foo[1]); } crashes the C compiler with a segmentation violation (sun only)! Oh, it recognizes the syntax error, but as soon as it tries to do something with the printf statement, it barfs with a seggie! Strange... dan (argv@sri-spam.arpa)