ref: ebdb4f888f8180ff7f937b9270cb003cb61bab7b
parent: 383358717731b29f0cbafc1f31d87fb79c1e7918
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 17 11:46:56 EDT 2014
Set unbuffered io This program is going to be tested usinga pipe with other program, and they will run interactivaly, so it is a good idea don't flush anything.
--- a/main.c
+++ b/main.c
@@ -1,6 +1,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include "cc.h"
@@ -12,6 +13,8 @@
int
main(int argc, char *argv[])
{
+ setvbuf(stdin, NULL, _IONBF, 0);
+ setvbuf(stdout, NULL, _IONBF, 0);
init_keywords();
init_expr();
open_file(NULL);