Discussion:
OpenVMS Alpha C++ bug in std::bitset<> STL implementation
(too old to reply)
RobertsonEricW
2017-05-15 12:47:03 UTC
Permalink
Did a quick google search for this bug and did not find anything. So, I am not certain everyone is aware of this bug. So I thought I would post it here to let everyone know. While I was attempting to build the current CMake on OpenVMS Alpha V8.3 (using the HP C++ V7.3-009 for OpenVMS Alpha V8.3 compiler) I came across the following build error:

49103 cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get(
49104 cmPolicies::PolicyID id) const
49105 {

Source Listing 14-MAY-2017 19:42:14 HP C++ V7.3-009 Page 946
14-MAY-2017 16:13:15 [cmake-3^.8^.1.Source]cmPolicies.cxx;1

49106 PolicyStatus status = cmPolicies::WARN;
49107
49108 if (this->Status[(POLICY_STATUS_COUNT * id) + OLD]) {
..................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands
operand types are: const std::bitset<204U> [ int ]

E if (this->Status[(3 * id) + OLD]) {
49109 status = cmPolicies::OLD;
49110 } else if (this->Status[(POLICY_STATUS_COUNT * id) + NEW]) {
.........................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands
operand types are: const std::bitset<204U> [ int ]

E } else if (this->Status[(3 * id) + NEW]) {
49111 status = cmPolicies::NEW;
49112 }
49113 return status;
49114 }

It turns out these error are caused by the missing const form of the std::bitset<N>::operator[](size_t pos) function in the bitset C++ header file. The const form is required in the context of the above function definition for cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id) because this is a const member function whose this pointer implicitly refers to a const cmPolicies::PolicyMap instance whose std::bitset<N> Status member is in turn also implicitly treated as const. Since there will be no more updates to the OpenVMS Alpha C++ Compiler I just fixed and replaced the errant bitset header file in the C++ header library SYS$LIBRARY:CXXL$ANSI_DEF.TLB. If anyone would like the fixed version just let me know and I will provide a copy of it.
Jan-Erik Soderholm
2017-05-15 13:03:00 UTC
Permalink
Post by RobertsonEricW
Did a quick google search for this bug and did not find anything. So, I
am not certain everyone is aware of this bug. So I thought I would post
it here to let everyone know. While I was attempting to build the
current CMake on OpenVMS Alpha V8.3 (using the HP C++ V7.3-009 for
49103 cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get( 49104
cmPolicies::PolicyID id) const 49105 { Source Listing
14-MAY-2017 19:42:14 HP C++ V7.3-009 Page 946
14-MAY-2017 16:13:15 [cmake-3^.8^.1.Source]cmPolicies.cxx;1
49106 PolicyStatus status = cmPolicies::WARN; 49107 49108 if
(this->Status[(POLICY_STATUS_COUNT * id) + OLD]) { ..................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E if (this->Status[(3 * id) + OLD]) { 49109 status =
cmPolicies::OLD; 49110 } else if (this->Status[(POLICY_STATUS_COUNT *
id) + NEW]) { .........................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E } else if (this->Status[(3 * id) + NEW]) { 49111 status =
cmPolicies::NEW; 49112 } 49113 return status; 49114 }
It turns out these error are caused by the missing const form of the
std::bitset<N>::operator[](size_t pos) function in the bitset C++ header
file. The const form is required in the context of the above function
definition for cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id)
because this is a const member function whose this pointer implicitly
refers to a const cmPolicies::PolicyMap instance whose std::bitset<N>
Status member is in turn also implicitly treated as const. Since there
will be no more updates to the OpenVMS Alpha C++ Compiler I just fixed
and replaced the errant bitset header file in the C++ header library
SYS$LIBRARY:CXXL$ANSI_DEF.TLB. If anyone would like the fixed version
just let me know and I will provide a copy of it.
using the HP C++ V7.3-009 for OpenVMS Alpha... ... Since there will
be no more updates to the OpenVMS Alpha C++ Compiler...
Note that a document that specifies what is included in the
VSI Alpha LP kit, says "VSI C++ 7.4-6".

What the differnce between 7.3-009 and 7.4-6 can be, I don't know.
Or if it is just renumbered with no changes...

Jan-Erik.
Jan-Erik Soderholm
2017-05-15 13:26:35 UTC
Permalink
Post by Jan-Erik Soderholm
Post by RobertsonEricW
Did a quick google search for this bug and did not find anything. So, I
am not certain everyone is aware of this bug. So I thought I would post
it here to let everyone know. While I was attempting to build the
current CMake on OpenVMS Alpha V8.3 (using the HP C++ V7.3-009 for
49103 cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get( 49104
cmPolicies::PolicyID id) const 49105 { Source Listing
14-MAY-2017 19:42:14 HP C++ V7.3-009 Page 946
14-MAY-2017 16:13:15 [cmake-3^.8^.1.Source]cmPolicies.cxx;1
49106 PolicyStatus status = cmPolicies::WARN; 49107 49108 if
(this->Status[(POLICY_STATUS_COUNT * id) + OLD]) { ..................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E if (this->Status[(3 * id) + OLD]) { 49109 status =
cmPolicies::OLD; 49110 } else if (this->Status[(POLICY_STATUS_COUNT *
id) + NEW]) { .........................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E } else if (this->Status[(3 * id) + NEW]) { 49111 status =
cmPolicies::NEW; 49112 } 49113 return status; 49114 }
It turns out these error are caused by the missing const form of the
std::bitset<N>::operator[](size_t pos) function in the bitset C++ header
file. The const form is required in the context of the above function
definition for cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id)
because this is a const member function whose this pointer implicitly
refers to a const cmPolicies::PolicyMap instance whose std::bitset<N>
Status member is in turn also implicitly treated as const. Since there
will be no more updates to the OpenVMS Alpha C++ Compiler I just fixed
and replaced the errant bitset header file in the C++ header library
SYS$LIBRARY:CXXL$ANSI_DEF.TLB. If anyone would like the fixed version
just let me know and I will provide a copy of it.
using the HP C++ V7.3-009 for OpenVMS Alpha... ... Since there will
be no more updates to the OpenVMS Alpha C++ Compiler...
Note that a document that specifies what is included in the
VSI Alpha LP kit, says "VSI C++ 7.4-6".
What the differnce between 7.3-009 and 7.4-6 can be, I don't know.
Or if it is just renumbered with no changes...
Jan-Erik.
B.t.w, the PDF document is available here. I got the link from the
site owner, but as far as I know it is public information.

http://www.woertman.com/Alpha-kit/

I see that all our compilers in use (C, Fortran and Cobol) has higher
versions here then what I think was the last version from HPE.

I think this was/is ment to be published on the HP Connect DE site
together with the "OpenVMS Spring 2017" supposium inforamtion.
But I cannot find anything so far...
Jan-Erik Soderholm
2017-05-15 13:27:18 UTC
Permalink
Post by Jan-Erik Soderholm
Post by Jan-Erik Soderholm
Post by RobertsonEricW
Did a quick google search for this bug and did not find anything. So, I
am not certain everyone is aware of this bug. So I thought I would post
it here to let everyone know. While I was attempting to build the
current CMake on OpenVMS Alpha V8.3 (using the HP C++ V7.3-009 for
49103 cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get( 49104
cmPolicies::PolicyID id) const 49105 { Source Listing
14-MAY-2017 19:42:14 HP C++ V7.3-009 Page 946
14-MAY-2017 16:13:15 [cmake-3^.8^.1.Source]cmPolicies.cxx;1
49106 PolicyStatus status = cmPolicies::WARN; 49107 49108 if
(this->Status[(POLICY_STATUS_COUNT * id) + OLD]) { ..................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E if (this->Status[(3 * id) + OLD]) { 49109 status =
cmPolicies::OLD; 49110 } else if (this->Status[(POLICY_STATUS_COUNT *
id) + NEW]) { .........................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E } else if (this->Status[(3 * id) + NEW]) { 49111 status =
cmPolicies::NEW; 49112 } 49113 return status; 49114 }
It turns out these error are caused by the missing const form of the
std::bitset<N>::operator[](size_t pos) function in the bitset C++ header
file. The const form is required in the context of the above function
definition for cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id)
because this is a const member function whose this pointer implicitly
refers to a const cmPolicies::PolicyMap instance whose std::bitset<N>
Status member is in turn also implicitly treated as const. Since there
will be no more updates to the OpenVMS Alpha C++ Compiler I just fixed
and replaced the errant bitset header file in the C++ header library
SYS$LIBRARY:CXXL$ANSI_DEF.TLB. If anyone would like the fixed version
just let me know and I will provide a copy of it.
using the HP C++ V7.3-009 for OpenVMS Alpha... ... Since there will
be no more updates to the OpenVMS Alpha C++ Compiler...
Note that a document that specifies what is included in the
VSI Alpha LP kit, says "VSI C++ 7.4-6".
What the differnce between 7.3-009 and 7.4-6 can be, I don't know.
Or if it is just renumbered with no changes...
Jan-Erik.
B.t.w, the PDF document is available here. I got the link from the
site owner, but as far as I know it is public information.
http://www.woertman.com/Alpha-kit/
I see that all our compilers in use (C, Fortran and Cobol) has higher
versions here then what I think was the last version from HPE.
I think this was/is ment to be published on the HP Connect DE site
together with the "OpenVMS Spring 2017" supposium inforamtion.
But I cannot find anything so far...
Just reposted using a "better" subject...

Jan-Erik.
Jan-Erik Soderholm
2017-05-15 13:29:14 UTC
Permalink
Post by Jan-Erik Soderholm
Post by Jan-Erik Soderholm
B.t.w, the PDF document is available here. I got the link from the
site owner, but as far as I know it is public information.
http://www.woertman.com/Alpha-kit/
I see that all our compilers in use (C, Fortran and Cobol) has higher
versions here then what I think was the last version from HPE.
I think this was/is ment to be published on the HP Connect DE site
together with the "OpenVMS Spring 2017" supposium inforamtion.
But I cannot find anything so far...
Just reposted using a "better" subject...
Jan-Erik.
No it wasn't, I forgot to change the subject. Trying again.

Sorry...

Jan-Erik.
John Reagan
2017-05-15 19:37:47 UTC
Permalink
Post by Jan-Erik Soderholm
Post by RobertsonEricW
Did a quick google search for this bug and did not find anything. So, I
am not certain everyone is aware of this bug. So I thought I would post
it here to let everyone know. While I was attempting to build the
current CMake on OpenVMS Alpha V8.3 (using the HP C++ V7.3-009 for
49103 cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get( 49104
cmPolicies::PolicyID id) const 49105 { Source Listing
14-MAY-2017 19:42:14 HP C++ V7.3-009 Page 946
14-MAY-2017 16:13:15 [cmake-3^.8^.1.Source]cmPolicies.cxx;1
49106 PolicyStatus status = cmPolicies::WARN; 49107 49108 if
(this->Status[(POLICY_STATUS_COUNT * id) + OLD]) { ..................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E if (this->Status[(3 * id) + OLD]) { 49109 status =
cmPolicies::OLD; 49110 } else if (this->Status[(POLICY_STATUS_COUNT *
id) + NEW]) { .........................1
%CXX-E-NOMATOPRFUN, (1) no operator "[]" matches these operands operand
types are: const std::bitset<204U> [ int ]
E } else if (this->Status[(3 * id) + NEW]) { 49111 status =
cmPolicies::NEW; 49112 } 49113 return status; 49114 }
It turns out these error are caused by the missing const form of the
std::bitset<N>::operator[](size_t pos) function in the bitset C++ header
file. The const form is required in the context of the above function
definition for cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id)
because this is a const member function whose this pointer implicitly
refers to a const cmPolicies::PolicyMap instance whose std::bitset<N>
Status member is in turn also implicitly treated as const. Since there
will be no more updates to the OpenVMS Alpha C++ Compiler I just fixed
and replaced the errant bitset header file in the C++ header library
SYS$LIBRARY:CXXL$ANSI_DEF.TLB. If anyone would like the fixed version
just let me know and I will provide a copy of it.
using the HP C++ V7.3-009 for OpenVMS Alpha... ... Since there will
be no more updates to the OpenVMS Alpha C++ Compiler...
Note that a document that specifies what is included in the
VSI Alpha LP kit, says "VSI C++ 7.4-6".
What the differnce between 7.3-009 and 7.4-6 can be, I don't know.
Or if it is just renumbered with no changes...
Jan-Erik.
Mostly just a renumber/rebrand to make the HPE and VSI versions "different". The VSI Alpha C++ kit (V7.4-008) is built from the current frontend sources with the LMF PAK producer changed to "VSI" and various copyrights changed. All of the VSI Alpha compilers have been updated to use a freshly built GEM as well. For most of them, I suspect that there are zero differences in the GEM functionality but I wanted all of them to use the same sources to make it easier for us to support/maintain them.
John Reagan
2017-05-15 19:33:58 UTC
Permalink
On Monday, May 15, 2017 at 8:47:04 AM UTC-4, RobertsonEricW wrote:
If anyone would like the fixed version just let me know and I will provide a copy of it.

I'll take the fixed version please. :) You can send it to my VSI account:

john dot reagan at vmssoftware dot com

as you'd expect
Loading...