Title: | C++ |
Notice: | Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS) |
Moderator: | DECCXX::AMARTIN |
Created: | Fri Nov 06 1987 |
Last Modified: | Thu Jun 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3604 |
Total number of notes: | 18242 |
Hello, I have a partner who is porting from Solaris to Digital UNIX 4.0, DEC C++ V5.4-006. They sent mail about an inline function being not being ignored when it's not being referenced. It's not clear to me what should be happening. Does anyone want to take a stab at it? Thanks. Pat Bryant Software Partner Engineering ------------------------------------------------- Take the following program: #include <stdio.h> extern int y; inline void x () { y = 10; } main() { } When I compile the program like this: cxx -inline all -O5 -o x x.cxx I get this: ld: Unresolved: y Why is that? The reference to y should just be ignored. Also, when I try to get a machine code listing, like this: cxx -inline all -O5 -S x.cxx There is no reference to y in the resulting file (x.s). But if I do this: cxx -inline all -O5 -c x.cxx nm x.o There is a reference to y: x.o: U _fpdata x.o: 0x00000000000000 T main x.o: U y Where is that reference coming from? Is there a way to get rid of it?
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3427.1 | help coming, but probably not in time | CAIRN::HARRIS | Kevin Harris, dtn 381-2039 | Tue Feb 04 1997 13:57 | 18 |
Pat, I checked this out. Three part answer: 1) DEC C++ makes no guarantees about what unnecessary program elements are eliminated. 2) However, the V5.n release compilers do try to eliminate the functions that are directly seen as unnecessary. This does not extend to functions and data that are referenced by unnecessary functions, however. 3) We're working on the next major release now, and I tested this example. That release DOES eliminate functions and data referenced only by unnecessary functions, and thus works with this example. So, no help currently, but fixed in the next major release of DEC C++. I assume the users can work around the problem by supplying a "y" when necessary. If this is not the case, let us know. -Kevin | |||||
3427.2 | Release dates? | HYDRA::BRYANT | Tue Feb 04 1997 14:52 | 9 | |
Kevin, Thanks for addressing this for me. Can I get an estimate of when V6.0 of C++ will be released. The quarter is sufficient? Thanks. Pat | |||||
3427.3 | too early to commit in public | CAIRN::HARRIS | Kevin Harris, dtn 381-2039 | Tue Feb 04 1997 14:57 | 8 |
Pat, >Can I get an estimate of when V6.0 of C++ will be released? The quarter is >sufficient. I'd better not. FT is scheduled to start in the Fall, but there is lots of new code to support the new std, so you can draw your own conclusions. -Kevin |