[QGIS-trac] Re: [Quantum GIS] #234: ISO C++ forbids casting between pointer-to-function and pointer-to-object

Quantum GIS qgis at qgis.org
Sat Nov 14 16:41:43 EST 2009


#234: ISO C++ forbids casting between pointer-to-function and pointer-to-object
-------------------------------------+--------------------------------------
        Reporter:  mloskot           |         Owner:  gsherman                
            Type:  enhancement       |        Status:  closed                  
        Priority:  minor: annoyance  |     Milestone:                          
       Component:  Build/Install     |       Version:  HEAD                    
      Resolution:  wontfix           |      Keywords:  casting pointer function
Platform_version:  Ubuntu 6.06       |      Platform:  Debian                  
        Must_fix:  No                |   Status_info:  0                       
-------------------------------------+--------------------------------------
Comment (by mloskot):

 Warming up an old steak, I've learned that the union-based cast used in
 [http://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgis.h#L110
 cast_to_fptr] is not necessary. GCC accepts [http://www.mr-
 edd.co.uk/?p=106 reinterpret_cast for purposes like in dlsym] calls as an
 extension:

 {{{
 #ifdef __GNUC__
 __extension__
 #endif
 isprovider_t *hasType =
 reinterpret_cast<isprovider_t*>(myLib->resolve("type"));
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/234#comment:17>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list