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"?
Asked
Active
Viewed 1.2k times
2 Answers
46
a.out stands for assembler output.
I think that justifies why most compilers have this name as default.
More info here.

sud03r
- 19,109
- 16
- 77
- 96
-
2a.out is also the name of the executable format. Makes for a nice handy 8.3 filename too though. – Matthew Scharley Aug 02 '09 at 07:16
-
2`a.out` has not been the default executable format for more than a decade. These days `ELF` (Executable Linkable Format) is used. – Jesper Juhl Jul 01 '16 at 16:04
-
@JesperJuhl But the question was not about what is in use currently, but about where did the name come from. Discussing other, more modern formats, is irrelevant to the question. – BarbaraKwarc Jul 01 '18 at 04:33
-
@BarbaraKwarc "assembler output" I think. – Jesper Juhl Jul 01 '18 at 05:42
8
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 ?

David-SkyMesh
- 5,041
- 1
- 31
- 38
-
1We never know if it won't break something. There might still be some tools that depend on this fact of automatically generated filenames for the resulting executable. Most of the *modern* tools don't, though. – BarbaraKwarc Jul 01 '18 at 04:35