I have a very very simple C++ file as follows that I\'m compiling on Solaris 5-10 with the CC compiler. Here is the source code in my file myTest.C:
#include
Try using CC -E in place of CC -P. When I do this thenm(1) listings are the same and the object files only differ by a few bytes (given that I can see the names of the *.c and *.i files in the *.o this difference is not surprising).
The man page doesn't really explain the difference between the two flags but does stress C++ for -E so I wonder if -P was intended to be C only.
If you're trying to work out what the direct method really entails, then this might prove enlightening:
truss -f -a -texec CC myFile.C
The direct compilation method doesn't call CC -P or CC -E but instead invokes ccfe with a whole raft of flags (and then fbe then ld...).