Why do some compilers use “a.out” as the default name for executables?

依然范特西╮ 提交于 2019-11-27 02:10:20

问题


Most UNIX C compilers link executables by default to a file called "a.out". Why? Is this a written standard or just de-facto standard behavior? What would break if these compilers would just produce an error message (or use a different default name) instead of producing "a.out"?


回答1:


a.out stands for assembler output.
I think that justifies why most compilers have this name as default. More info here.




回答2:


A.out is actually the name of an UNIX executable file format. (ELF is another)

The compiler produces that name (by tradition) if you don't give your executable a name explicitly.

What would break if these compilers would just error out instead of producing "a.out"?

Nothing would break, but what do you mean by 'error out'? Do you mean, refuse to compile unless an executable name is supplied to the linker ?



来源:https://stackoverflow.com/questions/1218262/why-do-some-compilers-use-a-out-as-the-default-name-for-executables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!