Khronos public bugtracker – Bug 621
const-correctness error in glext.h version 78 in GLDEBUGPROCARB type
Last modified: 2013-07-08 03:31:20 PDT
Version 78 of glext.h (or possibly and earlier version) changed the prototype for glDebugMessageCallbackARB from:
glDebugMessageCallbackARB (GLDEBUGPROCARB callback, GLvoid *userParam);
glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
I implemented this change in Mesa and found a new compiler warning about const-correctness. It seems to me that the GLDEBUGPROCARB type should also be changed from:
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam);
(the last param gets a const qualifier).
Making that change clears up the compiler warning in Mesa. But in any case, it seems logical to add the const qualifier to GLDEBUGPROCARB.
I'm not sure how the const got into glext.h originally, since it isn't
in the extension specs. I'm removing the 'const' attribute from the
userParam declarations for now, and opening an internal bug to ask
the GL & ES groups if they really want this parameter to be mutable.
If they say no then I'll change both prototype & type to the 'const'
This should be fixed now - the ARB/ES resolution was to const-ify
userParam in KHR_debug & GL API, and that's been done for ARB_debug_output