Sublime Forum

Execute compiled file, build system, not flusing

#1

I’m trying to execute my compiled c file from ST using this build system:

{
   "working_dir" : "$file_path",
  
   
   "selector": "source.x",
   
   "shell_cmd": "${file_path}/${file_base_name}.x",
   "file_regex":  "^([^:]*):([0-9]+):[0-9]+: (?:error|note):"



}

however:

printf("hello world \n");

does not print during execution, but only when i quit the program (that’s a big problem for me).

however:

 printf("hello world \n");
fflush(stdout);

Print immediately during exection.

Any idea ?

0 Likes

#2

I would say that you’re running afoul of line buffering issues, but you amended your question to include a newline on the printf call, which should stop that from happening.

Do you have a small representative example of a complete program that exhibits this behaviour?

0 Likes