home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Another C palindrome puzzle
- Message-ID: <9236108.5556@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <9234503.17437@mulga.cs.mu.OZ.AU> <9235703.672@mulga.cs.mu.OZ.AU> <1992Dec23.172745.12170@thunder.mcrcim.mcgill.edu>
- Date: Fri, 25 Dec 1992 21:28:26 GMT
- Lines: 45
-
- mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
-
- >In article <9235703.672@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >> manus@evolving.com (Manus Hand) writes:
- >
- >>> how about a palindromic "Hello world" program, with no comments,
- >>> #if's, #ifdef's, <<<OR #define's!>>>
- >> I liked your idea of using #pragma.
- >> Here's my solution with no comments, #ifs, #ifdefs, or #defines.
- >
- >> #pragma amgarp#;""\
- >
- >Oops. What about the FrobozzCo compiler, which takes the "amgarp"
- >pragma as a directive to place the author of the code into the world of
- >_The World According to Garp_? [...]
-
- Well... just so long as it still accepts the program :-).
-
- >Or older versions of gcc, which would give up on compiling and run rogue
- >when they happened across a #pragma of any sort?
-
- I think that these versions of gcc are not standard-conforming.
- I don't have the ANSI C standard, but the C++ ARM says that
- "an unrecognized pragma will be ignored", and I think that the C standard
- says something similar.
-
- So the program should be fine on all conforming implementations that don't
- recognize the pragma
- #pragma amgarp#;""
- ie., all conforming implementations ever actually implemented (but not of
- course the FrobozzCo compiler with the -mumble option specified ;-)
-
- But you're right of course, it's not strictly ANSI conforming.
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-