Khronos Public Bugzilla
Bug 621 - const-correctness error in glext.h version 78 in GLDEBUGPROCARB type
const-correctness error in glext.h version 78 in GLDEBUGPROCARB type
Status: RESOLVED FIXED
Product: OpenGL
Classification: Unclassified
Component: Registry
unspecified
All All
: P3 minor
: ---
Assigned To: Jon Leech
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-11 06:39 PDT by Brian Paul
Modified: 2013-07-08 03:31 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Paul 2012-04-11 06:39:36 PDT
Version 78 of glext.h (or possibly and earlier version) changed the prototype for glDebugMessageCallbackARB from:

 glDebugMessageCallbackARB (GLDEBUGPROCARB callback, GLvoid *userParam);

to:

 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);

to

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.
Comment 1 Jon Leech 2013-06-18 15:33:31 PDT
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'
form.
Comment 2 Jon Leech 2013-07-08 03:31:20 PDT
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
as well.