[Info-vax] OpenVMS Alpha C++ Compiler Bug
hb
end.of at inter.net
Wed Sep 10 14:46:53 EDT 2014
On 09/10/2014 07:24 PM, RobertsonEricW wrote:
> While porting the cmake project to OpenVMS (the first Open Source C++
project that I have had to deal with porting thus far), I came across
what appears to be an odd bug in the OpenVMS Alpha C++ V7.3-009 compiler
(which as far as I am aware is the latest version available from HP).
...
> The use of the /DEBUG qualifier (which is the only difference between
the above pairings of compile and link command sequences) should not
logically alter the necessity of any symbols defined within the
application itself. Hence their should not be any application defined
symbols that are unresolved when using the /DEBUG qualifier that are not
also unresolved without it. Use of the /NOOPT in both cases would imply
that this confusion is likely not contributed though code optimization
of any kind. Unfortunately, the only resolution I could come to was to
remove the "static" specifier for sfunc. This is not the best of
workarounds because removing the "static" specifier changes the linkage
of the sfunc symbol from internal to globally external. Which for the
particular purpose of defining the initialization function to be invoked
through LIB$INITIALIZE, is not generally desirable.
Maybe there is a bug, but there is also a C++ feature you may need to be
aware of.
I only have HP C++ V7.1-015 to play with. Maybe it behaves differently.
Dunno what the /DEBUG causes it to create your iniarray. Without /DEBUG
there is none and hence there is no reference to sfunc. Have a look at
the output of analyze/object and/or cxx/list/show=all/machine. "My"
compiler also doesn't create the LIB$INITIALIZE PSECT, neither with nor
without /DEBUG: the initialization will not work.
I added an "extern" to the variable "iniarray" to place it in the
PSECT LIB$INITIALIZE. Otherwise, with C++, "const" makes it static and
it goes into a different PSECT and the mechanism doesn't work. And as
far as I know if iniarray is static and isn't referenced, C++ doesn't
have to create it.
I haven't looked at I64, but it should be the same, although the
compiler is totally different.
More information about the Info-vax
mailing list