>>137
そこはおそらく君の思ったとおりの動作です。
core dumpする原因はgcc -Wallだと
  warning: format argument is not a pointer (arg 2)
とかいうメッセージが出てきます。