33

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

0

2 Answers 2

46

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

4
  • 2
    a.out is also the name of the executable format. Makes for a nice handy 8.3 filename too though. Aug 2, 2009 at 7:16
  • 2
    a.out has not been the default executable format for more than a decade. These days ELF (Executable Linkable Format) is used. Jul 1, 2016 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. Jul 1, 2018 at 4:33
  • @BarbaraKwarc "assembler output" I think. Jul 1, 2018 at 5: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 ?

1
  • 1
    We 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. Jul 1, 2018 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.