clang revealed bugs (Bug #708)


Added by nizar sallem over 14 years ago. Updated over 14 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi,

I've submit these bugs on the bug tracker at sourceforge.com but I can not check their status no more. They are real bugs but gcc seems to ignore them (may be unreachable code). The bugs are attached.
If you want help to fix them, I will be pleased to do.

Best,
Nizar


opencv.bugs (2.2 kB) nizar sallem, 2010-11-24 08:38 pm


Associated revisions

Revision 6e2708e0
Added by Andrey Kamaev almost 12 years ago

Merge pull request #708 from taka-no-me:gstreamer_10_28

History

Updated by Vadim Pisarevsky over 14 years ago

please, try out the latest SVN snapshot. It builds fine with Xcode 3.2.4 with CLang 1.5. The matrix expressions have been completely rewritten without using templates, so it must be better now, even if it still fails on your version of Clang.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Updated by nizar sallem over 14 years ago

Hi,

I am sorry, you are mistaken, here is the bug list from the svn checkout:

=========================================================================
Scanning dependencies of target opencv_features2d
[ 60%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/surf.o
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/src/surf.cpp:110:
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/src/precomp.hpp:54:
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:46:
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/../core/include/opencv2/core/core.hpp:4048:
/home/nizar/Work/opencv_checkout/modules/features2d/../core/include/opencv2/core/mat.hpp:760:64: warning: initialization of pointer of type 'cv::Range const ' from literal 'false'
[-Wbool-conversions]
Mat _u(u, false), _w(w, false), _vt(vt, false), _rhs(_rhs, false), _dst(dst, false);
^
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/src/surf.cpp:110:
In file included from /home/nizar/Work/opencv_checkout/modules/features2d/src/precomp.hpp:54:
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1289:32: note: default argument declared here
Params( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1.,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1289:58: note: default argument declared here
Params( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1.,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1289:83: note: default argument declared here
Params( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1.,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1290:31: note: default argument declared here
int blockSize=3, bool useHarrisDetector=false, double k=0.04 );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1290:57: note: default argument declared here
int blockSize=3, bool useHarrisDetector=false, double k=0.04 );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1302:84: error: use of default argument to function 'Params' that is declared later in
class 'Params'
GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=GoodFeaturesToTrackDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1290:73: note: default argument declared here
int blockSize=3, bool useHarrisDetector=false, double k=0.04 );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1382:40: note: default argument declared here
Params( float initFeatureScale=1.f, int featureScaleLevels=1, float featureScaleMul=0.1f,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1382:68: note: default argument declared here
Params( float initFeatureScale=1.f, int featureScaleLevels=1, float featureScaleMul=0.1f,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1382:93: note: default argument declared here
Params( float initFeatureScale=1.f, int featureScaleLevels=1, float featureScaleMul=0.1f,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1383:32: note: default argument declared here
int initXyStep=6, int initImgBound=0, bool varyXyStepWithScale=true, bool varyImgBoundWithScale=false );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1383:52: note: default argument declared here
int initXyStep=6, int initImgBound=0, bool varyXyStepWithScale=true, bool varyImgBoundWithScale=false );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1383:80: note: default argument declared here
int initXyStep=6, int initImgBound=0, bool varyXyStepWithScale=true, bool varyImgBoundWithScale=false );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1395:70: error: use of default argument to function 'Params' that is declared later in
class 'Params'
DenseFeatureDetector( const DenseFeatureDetector::Params& params=DenseFeatureDetector::Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:1383:113: note: default argument declared here
int initXyStep=6, int initImgBound=0, bool varyXyStepWithScale=true, bool varyImgBoundWithScale=false );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2443:33: note: default argument declared here
Params( int poseCount = POSE_COUNT,
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2444:34: note: default argument declared here
Size patchSize = Size(PATCH_WIDTH, PATCH_HEIGHT),
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2445:38: note: default argument declared here
string pcaFilename = string(),
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2446:36: note: default argument declared here
string trainPath = string(), string trainImagesList = string(),
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2446:71: note: default argument declared here
string trainPath = string(), string trainImagesList = string(),
^
/home/nizar/Work/opencv_checkout/modules/features2d/include/opencv2/features2d/features2d.hpp:2459:51: error: use of default argument to function 'Params' that is declared later in
class 'Params'
OneWayDescriptorMatcher( const Params& params=Params() );
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
maker2:
[modules/features2d/CMakeFiles/opencv_features2d.dir/src/surf.o] Error 1
maker1:
[modules/features2d/CMakeFiles/opencv_features2d.dir/all] Error 2
make: *
* [all] Error 2 ===============================================================================
cmake version is 2.8.3 and clang version is 2.8

  • Status changed from Done to Cancelled
  • (deleted custom field) deleted (fixed)

Updated by Vadim Pisarevsky over 14 years ago

ok, I looked closely at those bugs; the C++ constructs it does not like are absolutely correct, and I do not see any possible workaround. OpenCV is built fine using llvm-g++-4.2 (on Ubuntu 10.10 x64), and using Apple's clang 1.5 (I think, they use different version numbering scheme), but not with Ubuntu's clang 2.8. Visual Studio C++ compiler also builds OpenCV fine.

I conclude that this is lack of C++ support in the current clang frontend. So, we just have to wait for clang updates.

  • Status changed from Cancelled to Done
  • (deleted custom field) set to wontfix

Also available in: Atom PDF