Bug 533 - Fails to compile with -Wcast-qual (Eigen 3.2.1)
Fails to compile with -Wcast-qual (Eigen 3.2.1)
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Core - general
3.1
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-30 00:59 UTC by Christian Eisenacher
Modified: 2012-12-16 20:37 UTC (History)
2 users (show)



Attachments

Description Christian Eisenacher 2012-11-30 00:59:49 UTC
Eigen/src/Core/Transpose.h:356: error: cast from type ‘const float*’ to type ‘float*’ casts away constness


Problem:
    return (bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed) && (dest!=0 && dest==(Scalar*)extract_data(src));


Possible solution:
    return (bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed) && (dest!=0 && dest==const_cast<Scalar*>(extract_data(src)));
Comment 1 Gael Guennebaud 2012-12-16 20:37:33 UTC
https://bitbucket.org/eigen/eigen/changeset/45efb1ce0f2b/
changeset:   45efb1ce0f2b
branch:      3.1
user:        ggael
date:        2012-12-16 20:36:59
summary:     Fix bug 533: add some missing const qualifiers (was already fixed in devel branch)

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