Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"?

like image 538
Ville Laurikari Avatar asked Aug 02 '09 05:08

Ville Laurikari


People also ask

Why is a out default?

"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.

Why is it called a out?

a. out stands for assembler output.

What is the default filename for an executable?

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).

Is a out the same as a exe?

out is the standard unnamed output file on a Unix system. .exe is an executable file for DOS and Windows.


2 Answers

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 ?

like image 45
David-SkyMesh Avatar answered Sep 26 '22 21:09

David-SkyMesh


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

like image 149
sud03r Avatar answered Sep 22 '22 21:09

sud03r