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"?
"a. out" remains the default output file name for executables created by certain compilers and linkers when no output name is specified, even though the created files actually are not in the a. out format.
a. out stands for assembler output.
Executable code can be produced by compiling and linking in one step. An executable file has a filename extension of .exe (Windows) or no filename extension (UNIX).
out is the standard unnamed output file on a Unix system. .exe is an executable file for DOS and Windows.
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 ?
a.out stands for assembler output.
I think that justifies why most compilers have this name as default. More info here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With