I have not checked the coding rules defined for OpenCV but in most projects I have been involved in using "goto" is forbidden. I think the compiler option "-fpermissive" has been added to avoid such some writtings.

Using "goto" has many drawbacks:
  - lisibility of the source code
  - usage of guard conditions (asserts at both ends of a function) is not possible
  - etc.

We can write efficient code without having to use this kind of instruction. If not, we should perhaps go back from ten or twenty years, at a time where we had to write assembly code to program efficiently...

By the way, I am also using other GCC options to help us writting better code which <b>could be usefull</b>.
In particular: <b>-Wcast-qual, -Wconversion and -Wfloat-equal</b>.
With the options, we can detect some possible improvement in the code. For example:
[..]/include/opencv2/core/mat.inl.hpp: In member function 'cv::SparseMat::Node* cv::SparseMatIterator::node() const':
[..]//include/opencv2/core/mat.inl.hpp:2559:59: warning: cast from type 'const cv::SparseMat::Node*' to type 'cv::SparseMat::Node*' casts away qualifiers [-Wcast-qual]
     return (SparseMat::Node*)SparseMatConstIterator::node();



###### Please find hereafter the errors I got:
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp: In member function 'virtual bool CvCaptureCAM_XIMEA::open(int)':
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:108:1: error: jump to label 'error' [-fpermissive]
 error:
 ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:88:29: error:   from here [-fpermissive]
     if(mvret != XI_OK) goto error;
                             ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:90:9: error:   crosses initialization of 'int height'
     int height = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:108:1: error: jump to label 'error' [-fpermissive]
 error:
 ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:84:29: error:   from here [-fpermissive]
     if(mvret != XI_OK) goto error;
                             ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:90:9: error:   crosses initialization of 'int height'
     int height = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:86:9: error:   crosses initialization of 'int width'
     int width = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:108:1: error: jump to label 'error' [-fpermissive]
 error:
 ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:80:29: error:   from here [-fpermissive]
     if(mvret != XI_OK) goto error;
                             ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:90:9: error:   crosses initialization of 'int height'
     int height = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:86:9: error:   crosses initialization of 'int width'
     int width = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:108:1: error: jump to label 'error' [-fpermissive]
 error:
 ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:76:29: error:   from here [-fpermissive]
     if(mvret != XI_OK) goto error;
                             ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:90:9: error:   crosses initialization of 'int height'
     int height = 0;
         ^
opensource_workspace\opencv\modules\highgui\src\cap_ximea.cpp:86:9: error:   crosses initialization of 'int width'
     int width = 0;
         ^
mingw32-make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ximea.cpp.obj] Error 1
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
mingw32-make: *** [all] Error 2