次のコードをコンパイルしているときに、異常なコンパイル時エラーが発生しました。
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
if (open("b.txt", O_CREAT | O_RDWR | O_TRUNC, 0777) < 0) {
perror("open error:");
exit(1);
}
return 0;
}
を含まないディレクトリ内b.txt
。
以下はエラーです:
test.c:1:0: fatal error: can’t open /tmp/ccrlx6NY.s for writing: Permission denied
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
GNU/Linux (3.2.0-39-generic)
オペレーティング システムとgcc
コンパイラ バージョン 4.6.3 を使用しています。
$df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 44240004 10753148 31239588 26% /
udev 1004132 4 1004128 1% /dev
tmpfs 406548 1228 405320 1% /run
none 5120 0 5120 0% /run/lock
none 1016364 236 1016128 1% /run/shm
/dev/sda7 80731936 47718056 28912916 63% /home
このメッセージが表示される正確な理由は何ですか?
PS: コンパイルするすべてのファイルで実際にこのエラーが発生しています。