IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

1985/sicherman - Worst abuse of the C preprocessor

← shapiro ↑ 1985 ↑ last entry C code Makefile Inventory





Author:

To build:

make all

There is another version that will be compiled in case the first fails. This should happen automatically. See Alternate code below for more details on it.

To use:

./sicherman < file

echo foo | ./sicherman

./sicherman
# type or paste some text, making sure to hit enter after each line typed

Try:

./try.sh

Alternate code:

The sicherman.alt.c is a slight change in the fixed version (fixed so it does not require -traditional-cpp) in that it has two args to main() as some compilers object to certain number of args in main(). This will be built in the case of the sicherman.c failing to compile. In this case it’ll be compiled to sicherman to simplify it for the larger audience.

Alternate build:

Although this will be built if the original fails to compile you can do it manually like:

make alt

In this case it will be built as sicherman.alt.

Alternate use:

./sicherman.alt < file

Alternate try:

./try.alt.sh

Judges’ remarks:

This program abuses the C preprocessor so much that some cpps fail to strip out all of the comments on the first pass! If you were able to understand Decot’s entry in 1984, you will have a head start on this one.

Be sure to run this program through lint! If your lint works correctly, it should warn you that the argument ‘Manual’ isn’t used. Like the program says, what’s that mean?

Run the program without arguments and enter the letters ‘a’ through ‘m’ on a line. Now enter the letters ‘n’ through ‘z’. But to borrow a quote from Richard Stallman: If you think you understand what this code does, then you don’t, so read it again! Explain why:

./sicherman < sicherman.c | ./sicherman | diff - ./sicherman.c

results in diff reporting a difference on some machines.

Author’s remarks:

No remarks were provided by the author.

Inventory for 1985/sicherman

Jump to top

Primary files

Secondary files