https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64094
--- Comment #6 from Jon Grant <jg at jguk dot org> --- Two more tests where I try to pass directories to GCC. (1) $ mkdir testdir $ gcc -Wall -Werror -o main testdir testdir: file not recognized: Is a directory collect2: error: ld returned 1 exit status (2) $ mkdir testdir.cpp $ gcc -o main testdir.cpp cc1plus: fatal error: testdir.cpp: No such file or directory compilation terminated. Re (1) output reasonable. Although I don't know why it is getting all the way to LD after the error? Re (2) error handling not quite right, appears to have slipped through, because it had .cpp extension? Perhaps each "filename" could be checked with if (stat(pathname, &sb) == 0 && S_ISDIR(sb.st_mode))