X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=examples%2FKaleidoscope%2FChapter6%2Ftoy.cpp;h=9d9914a4b89aa9d342811582fdb547151e4881e4;hb=8c46d7964e996f60e4cf0f8ee08be5da22ddf1a3;hp=e1bed45189e0593d36c113036b200757080b7f9f;hpb=742f5d8f37c26df6c5f1bf27e258a038c757bb07;p=oota-llvm.git diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index e1bed45189e..9d9914a4b89 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -1023,14 +1023,14 @@ static void MainLoop() { //===----------------------------------------------------------------------===// /// putchard - putchar that takes a double and returns 0. -extern "C" double putchard(double X) { - putchar((char)X); +__attribute__((used)) extern "C" double putchard(double X) { + fputc((char)X, stderr); return 0; } /// printd - printf that takes a double prints it as "%f\n", returning 0. -extern "C" double printd(double X) { - printf("%f\n", X); +__attribute__((used)) extern "C" double printd(double X) { + fprintf(stderr, "%f\n", X); return 0; }