[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

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

3430.0. "%CXX-E-NONCONSTCALL on per 7.0 Alpha systems" by CSC32::E_VAETH (Suffering from temporary brain cramp, stay tuned) Tue Feb 04 1997 16:35

OpenVMS Alpha V6.2-1H3
DEC C++ 5.4

It looks like the 5.4 installation checks the version of OpenVMS and if it is
lower than 7.0, then the .V50 flavors of the headers are installed.  This causes
a problem for this customer.  He has something like:

void test(const String &foo)
{
String bar=foo(0,5);
}

The compiler complains:

 String bar=foo(0,5);
.............^
%CXX-E-NONCONSTCALL, In this declaration, "foo(0,5)" applies a non-const

This seems valid and I was not able to reproduce what he was seeing. I had been
testing on an OpenVMS 7.0 system.  The difference between the .V50 string.hxx is
missing the following:
 
	String                      operator()(int, int) const;

Is this expected?  Is his solution to use the string.hxx from the default
CXXL$DEF_HXX.tlb?  Or will this cause other problems?? What is the right thing
to do for him (without having to upgrade to OpenVMS 7.0)?


Thanks,

Elin
T.RTitleUserPersonal
Name
DateLines
3430.1Found out late in the gameHNDYMN::MCCARTHYA Quinn Martin ProductionWed Feb 05 1997 07:0832
Elin,

Your description of what the compiler does is correct.  It was not 
until very close to the SSB release of 5.5 on OpenVMS Alpha was this 'issue'
brought up.  

I think it all started because the C++ compiler initially did not define
__VMS_VER so header files could not be fixed for all platforms.  So when 
the problem you reported was fixed in our "mainline" code, it was not fixed
in the right version that gets installed on pre 7.0 systems.

There is some goodness to this however.  Because, at times, fixes are made
in header files that also releate to fixes in run time (such as a new
entry point into cxxl$011_shr - yuck!) this can not be determined only by 
OS version at compile time.  

A good example is some work we did with __int64.  If the header file 
with this function 'enabled' were installed on a pre 7.1 system (maybe 7.0, I'd
have to check), a compile would succeed but a link would fail to find the run
time behind the calls. If we ever release a  TIMA kit with that support in it,
then a new header  file would have to be included, again - yuck.

I'm going to try to get some of this straightened out so header-file only
bug fixes get released on all platforms.

As for the fix for this problem, as hinted to above, using the lastest header 
files may cause some link time failures and I will have to double check 
to see if the const issue was a header-file only fix.

Sorry for the confusion.

Brian J.
3430.2needs runtime HNDYMN::MCCARTHYA Quinn Martin ProductionWed Feb 05 1997 10:2027
The fix for this specific problem is in the runtime and available with V7.0.

It is not planned to be put in any TIMA kit.  Even if it was, the header file
would have to be updated, something a TIMA kit (any platform) has never
done.

So to answer all your questions:

>>Is this expected? 

With this fix, yes.

>> Is his solution to use the string.hxx from the default CXXL$DEF_HXX.tlb?  

No.  The new routine to fix the problem described is not available until
OpenVMS V7.0 (I still need to verify that its 7.0 and not 7.1).

>>Or will this cause other problems?? 

See .1 for problems that will cause.  

>>What is the right thing to do for him (without having to upgrade to 
>>OpenVMS 7.0)?

Upgrade to OpenVMS V7.1 ? :-)

Brian J.
3430.3Thanks... a workaround?CSC32::E_VAETHSuffering from temporary brain cramp, stay tunedWed Feb 05 1997 11:1114
Thanks for the info so far.  If the string.hxx he needs is not available until
7.0/7.1, what can be done to make the following compile??

#include <string.hxx>

void test(const String &foo)
{
String bar=foo(0,5);
}

Thanks,

Elin

3430.4call non-const version of operator()DECC::J_WARDWed Feb 05 1997 11:3616
// I can think of three different workarounds

#include "String.hxx"

// 1. make this argument non-const
void test(const String& foo)
{
	//String bar= foo(0,5);

	// 2. OR change the above to cast foo to non-const
	//String bar= ((String &) foo)(0,5);

	// 3. OR create a temporary (non-const) String
	String tmpfoo = foo;
	String bar = tmpfoo(0,5);
}
3430.5Thanks !CSC32::E_VAETHSuffering from temporary brain cramp, stay tunedWed Feb 05 1997 12:460