5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GCCイースターエッグ

Last updated at Posted at 2016-04-01

GCC Easter Egg: C++ Undefined Defined Behavior

GCC 1.171に存在したらしいイースターエッグ。未知の#pragmaに遭遇すると、勝手にNetHackやRouge2, Emacs上でハノイの塔シミュレータを起動する。いずれも存在しなければメッセージ"You are in a maze of twisty compiler features, all different"3を表示する。

(引用元でも言及されている通り、現在のC/C++言語仕様上は未定義動作(undefined behavior)ではなく、処理系定義(implementation defined)な動作であるといえる。ANSI C言語仕様が1989年策定ということを考慮すると野暮な話ではあるが。)

  1. GCC 1.17は1988年にリリースされたバージョン。

  2. いわゆるローグライクゲームの元祖。

  3. PDP-10用アドベンチャーゲーム Colossal Cave Adventure からのパロディらしい。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?