Bug 2223035 - boost::numeric::ublas::vector list initializer not working
Summary: boost::numeric::ublas::vector list initializer not working
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: boost1.78
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Denis Arnaud
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-14 21:56 UTC by Brad Bell
Modified: 2024-05-28 13:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-28 13:30:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Brad Bell 2023-07-14 21:56:19 UTC
This is related to the following boost bug:
https://github.com/boostorg/ublas/issues/63

Which was supposedly fixed by on Apr 12, 2020.
The version of boost on Fedora 38 is 1.78.0 which corresponds to Dec 1, 2021; see
https://github.com/boostorg/boost/releases/tag/boost-1.78.0

Reproducible: Always

Steps to Reproduce:
Store the script in Additional Information as boost_vector.sh and run it as follows:
  ./boost_vector.sh boost

Actual Results:  
boost>./boost_vector.sh boost
boost_vector.cpp: In function ‘int main()’:
boost_vector.cpp:5:57: error: narrowing conversion of ‘1.0e+0’ from ‘double’ to ‘boost::numeric::ublas::vector<double>::size_type’ {aka ‘long unsigned int’} [-Wnarrowing]
    5 | {  boost::numeric::ublas::vector<double> v = { 1.0, 2.0 };
      |                                                         ^
boost>


Expected Results:  
boost>./boost_vector.sh boost
boost_vector: OK
boost>


#! /usr/bin/env bash
set -u -e
if [ $# != 1 ]
then
   echo 'usage: ./boost_vector.sh (std|boost)'
   exit 1
fi
if [ "$1" == 'std' ]
then
   vector_type="std::vector<double>"
else
   vector_type="boost::numeric::ublas::vector<double>"
fi
cat << EOF > boost_vector.cpp
# include <vector>
# include <boost/numeric/ublas/vector.hpp>

int main(void)
{  $vector_type v = { 1.0, 2.0 };
   if( v.size() == 2 && v[0] == 1.0 && v[1] == 2.0 )
      return 0;
   return 1;
}
EOF
g++ boost_vector.cpp -o boost_vector
if ! ./boost_vector
then
   echo 'boost_vector: Error'
   exit 1
fi
#
echo 'boost_vector: OK'
exit 0

Comment 1 Aoife Moloney 2024-05-28 13:30:24 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.