如果未指定 -sync_stdio,编译器会将其设置为 -sync_stdio=yes。
请看以下示例:
#include <stdio.h>
#include <iostream>
int main()
{
std::cout << "Hello ";
printf("beautiful ");
std::cout << "world!";
printf("\n");
}
|
使用同步时,程序自行打印在一行中
Hello beautiful world! : |
不使用同步时,输出会变得杂乱。
此选项仅对链接可执行文件有效,对库无效。