Skip to content

Instantly share code, notes, and snippets.

@anastasop
Created September 17, 2012 20:25
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anastasop/3739562 to your computer and use it in GitHub Desktop.
Save anastasop/3739562 to your computer and use it in GitHub Desktop.
smiley.c
// 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(☻☺☹);
}
@girng
Copy link

girng commented Oct 9, 2019

hacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment