Print this page
cw: don't shadow pure pre-processing
cw(1onbld): --shadow not --secondary

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/cw/cw.1onbld
          +++ new/usr/src/tools/cw/cw.1onbld
↓ open down ↓ 43 lines elided ↑ open up ↑
  44   44  numbers of makefiles.
  45   45  A mode called shadow compilation invokes multiple compilers so that warnings
  46   46  and errors may be obtained from both.
  47   47  See SHADOW COMPILATION for details.
  48   48  This version of cw supports compilers with both Sun Studio 12 and GCC-style
  49   49  command lines.
  50   50  .Sh ARGUMENTS
  51   51  Both the
  52   52  .Fl -primary
  53   53  and
  54      -.Fl -secondary
       54 +.Fl -shadow
  55   55  parameters take a
  56   56  .Em compiler specification .
  57   57  This is a comma-separated list of the form
  58   58  .Ar name,executable,style
  59   59  Where
  60   60  .Ar name
  61   61  is a name for the compiler,
  62   62  .Ar executable
  63   63  is the full path to the compiler executable, and
  64   64  .Ar style
↓ open down ↓ 61 lines elided ↑ open up ↑
 126  126  .El
 127  127  .Sh SHADOW COMPILATION
 128  128  If
 129  129  .Fl -shadow
 130  130  compilers are specified
 131  131  .Nm cw
 132  132  will invoke shadow compiler, with the outputs modified (as well as any
 133  133  translation for compiler style) as follows:
 134  134  .Bl -enum
 135  135  .It
 136      -If none of
      136 +If neither of 
 137  137  .Fl c ,
 138      -.Fl E ,
 139      -.Fl P ,
 140      -or
 141  138  .Fl S
 142      -appears in the argument list (that is, linking is attempted), the shadow
 143      -compilers will not be invoked.
 144      -This is because the objects built with that compiler which would be linked
 145      -have been previously discarded.
      139 +appears in the argument list (that is, linking is attempted or only the
      140 +pre-processor is invoked), the shadow compilers will not be invoked.
 146  141  .It
 147  142  If the
 148  143  .Fl o Ar filename
 149  144  option was provided, with or without a separating space, it will be replaced with
 150  145  .Fl o Ar tempfile
 151  146  .It
 152  147  If the option
 153  148  .Fl o
 154  149  was not provided,
 155  150  .Fl o Ar tempfile
↓ open down ↓ 2 lines elided ↑ open up ↑
 158  153  .El
 159  154  When shadow compilation is in effect,
 160  155  .Nm cw
 161  156  writes to standard error each compiler's standard error output following its
 162  157  argument list.
 163  158  Messages from the compilers will not be interleaved.
 164  159  If
 165  160  .Nm cw
 166  161  is used to invoke the preprocessor and no output location is specified,
 167  162  .Nm cw
 168      -will write to standard output the primary compiler's standard output, and the
 169      -secondary compiler's standard output will be discarded.
      163 +will write to standard output the primary compiler's standard output.
 170  164  .Pp
 171  165  Because the Sun compilers write intermediate objects to fixed
 172  166  filenames in the current directory when instructed to compile and
 173  167  link multiple source files via a single command line, it would be
 174  168  unsafe to invoke more than one compiler in this fashion.
 175  169  Therefore
 176  170  .Nm cw
 177  171  does not accept multiple source files unless the preprocessor is to be
 178  172  invoked.
 179  173  An attempt to invoke
↓ open down ↓ 44 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX