Smiles
(Another resurrected post from the my old Google stream, which appeared on or about Dec 6, 2011.)
For unknown reasons, someone asked me if had a copy of this file today. I didn't, but I remembered it was in dmr's home directory, and asked a friend there to find it. I remembered correctly. I don't know why it was touched in 1993, but the .v (mips object file) was created in late 1992. I leave the significance of that date as an exercise for the reader.
By the way, sizeof(void) is illegal, so I'm unsure how it was compiled; my friend assures me the compilers from then didn't accept it either.
Because G refuses to leave the indentation alone and screws up the ls formatting, I'm posting a screen grab here, but i'll include the source code, poorly formatted and rudely scrubbed of indentation, so you can play with the bytes. Just for fun, after the first screen grab I'll post a second screen grab of this post in edit mode before I hit save.
#include <u.h>
#include <libc.h>
typedef int ☺☹☻;
typedef void ☹☺☻;
enum
{
☹☻☺ = sizeof(☺☹☻),
☻☺☹ = sizeof(☹☺☻),
};
☹☺☻
main(☹☺☻)
{
☺☹☻ ☺☻☹;
for(☺☻☹=☻☺☹; ☺☻☹<☹☻☺; ☺☻☹ )
print("☺☻☹ = %d\n", ☺☻☹);
exits(☻☺☹);
}
For unknown reasons, someone asked me if had a copy of this file today. I didn't, but I remembered it was in dmr's home directory, and asked a friend there to find it. I remembered correctly. I don't know why it was touched in 1993, but the .v (mips object file) was created in late 1992. I leave the significance of that date as an exercise for the reader.
By the way, sizeof(void) is illegal, so I'm unsure how it was compiled; my friend assures me the compilers from then didn't accept it either.
Because G refuses to leave the indentation alone and screws up the ls formatting, I'm posting a screen grab here, but i'll include the source code, poorly formatted and rudely scrubbed of indentation, so you can play with the bytes. Just for fun, after the first screen grab I'll post a second screen grab of this post in edit mode before I hit save.
#include <u.h>
#include <libc.h>
typedef int ☺☹☻;
typedef void ☹☺☻;
enum
{
☹☻☺ = sizeof(☺☹☻),
☻☺☹ = sizeof(☹☺☻),
};
☹☺☻
main(☹☺☻)
{
☺☹☻ ☺☻☹;
for(☺☻☹=☻☺☹; ☺☻☹<☹☻☺; ☺☻☹ )
print("☺☻☹ = %d\n", ☺☻☹);
exits(☻☺☹);
}


Published on April 04, 2020 15:19
No comments have been added yet.
Rob Pike's Blog
- Rob Pike's profile
- 29 followers
Rob Pike isn't a Goodreads Author
(yet),
but they
do have a blog,
so here are some recent posts imported from
their feed.
