Created
September 17, 2012 20:25
-
-
Save anastasop/3739562 to your computer and use it in GitHub Desktop.
smiley.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the smiley program demonstrated by Russ Cox at http://research.swtch.com/acme | |
// it shows that the plan9 compiler http://plan9.bell-labs.com/sys/doc/comp.html fully supports UTF-8 | |
// i tried to compile it with a recent version of the plan9 compiler running on vmware but it failed. | |
// it seems that older versions of the compiler supported sizeof(void) == 0 | |
// anyway you get the idea | |
#include <u.h> | |
#include <libc.h> | |
typedef int ☺☹☻; | |
typedef void ☹☺☻; | |
enum | |
{ | |
☹☻☺ = sizeof(☺☹☻), | |
☻☺☹ = sizeof(☹☺☻) | |
}; | |
☹☺☻ | |
main(☹☺☻) | |
{ | |
☺☹☻ ☺☻☹; | |
for (☺☻☹ = ☻☺☹; ☺☻☹ < ☹☻☺; ☺☻☹++) | |
print("☺☻☹ = %d\n", ☺☻☹); | |
exits(☻☺☹); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hacks