Technical article 101457

The '-o' flag to CC does not work when used in conjunction with '-c'.

OpenServer 5.0.0

Written · Last revised

Problem

When using the '-o' flag together with the '-c' flag to CC,
the resulting object filename is not the one specified, but
instead defaults to <progname>.o.  For example:
CC -c test.C -o obj.o

will generate an object file called "test.o" and not "obj.o".

Solution

This has been reported to SCO Engineering.

To correct this behavior, modify the shell script /usr/bin/CC. Change the line 1196 which originally reads:

(cd $TEMPDIR; eval $ccC $udeflist $EC $P $NLO -I$OLDDIR $X)

and add the shell variable $OF as an argument to $ccC as follows:

(cd $TEMPDIR; eval $ccC $OF $udeflist $EC $P $NLO -I$OLDDIR $X)

From the Xinuos technical article database, record 101457. Reproduced with permission. The original is at www.sco.com/ta/101457, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.