-
Type:
Bug
-
Status: Closed
-
Priority:
P3: Somewhat important
-
Resolution: Done
-
Affects Version/s: 3.x
-
Fix Version/s: 5.0.0
-
Component/s: GUI: OpenGL
-
Labels:None
-
Commits:9702400e2d45c074922e488e01ab8ade82431b47
The return type of QGLContext::getProcAddress() should be a function pointer and not a data pointer. The wrapped function glXGetProcAddress() has the correct prototype, but for some reason the QGLContext method deviates from the correct GLX API. According to the C and C++ standards, it is valid to cast between different function pointer types, as long as the actual call is made through a pointer with the original signature of the function pointed to. However, the standard explicitly does not make the same guarantee for the conversion from a function pointer to a non-function pointer and back.
Strictly speaking, it should be a pointer to a function with C linkage:
extern "C"
{ typedef void (*QGLProc)(); } ...
QGLProc getProcAddress(const QString&);
This is an API bug, and the invalid type conversion will cause compilers to complain with the right warning settings.