[Nickle]crashing nickle in <100 bytes
Carl Worth
nickle@nickle.org
Tue, 23 Jul 2002 18:18:39 +0000
While Keith and Bart try to solve my last riddle, here's a new one:
typedef list;
typedef struct {
list next;
} list;
list burn = {next = 0};
crash = burn;
The assignment to burn yields the following legitimate and polite
error message, (notice the missing '*' in the struct definition):
Incompatible types 'list', 'union { int; *poly; }' in struct initializer
The assignment to crash yields the following not-so-polite message:
Segmentation fault
-Carl
PS. Would it make sense to have a literal other than 0 to represent a
null pointer? I've got a code segment hear that I think would be
useful with a function accepting a poly that could legitimately be an
integer, (such as 0), or a null pointer. Anything I can do for that
already?
--
Carl Worth
USC Information Sciences Institute cworth@east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203 703-812-3725