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

后端 未结 2 1405
轻奢々
轻奢々 2020-12-09 08:16

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 thes

相关标签:
2条回答
  • 2020-12-09 09:03

    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 ?

    0 讨论(0)
  • a.out stands for assembler output.
    I think that justifies why most compilers have this name as default. More info here.

    0 讨论(0)
提交回复
热议问题