How to understand the term 'unit' in 'unit-at-a-time'?

Ian Lance Taylor iant@google.com
Wed Mar 25 13:28:00 GMT 2009


QiangHuang <qianghuang87@gmail.com> writes:

>       GCC now has two styles for compilation, one for
> 'function-at-atime', and the other for 'unit-at-a-time'.
>       The term 'unit' in this word refers to a whole source file ? or
> something else.
>
>       Could someone make an exact definition about it?
>       And How the compiler make the decision that if the functions are
> in the same compilation unit.

"unit" refers to a single compilation unit, meaning everything that the
compiler sees in a single invocation.  The decision is made by the
command line options.

However, note that as of gcc 4.4 (not yet released) the compiler only
supports unit-at-a-time mode.  function-at-a-time mode has been
eliminated.

Ian



More information about the Gcc-help mailing list