Bugzilla – Bug 1221689
GCC 14: gle package fails
Last modified: 2024-03-29 23:59:07 UTC
Building gle with GCC 14 fails here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/gle/standard/x86_64 Due to (exhaustive list of errors): ex_angle.c: In function 'draw_angle_style_front_cap': ex_angle.c:114:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 114 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} In file included from port.h:200, from ex_angle.c:28: /usr/include/GL/glu.h:336:87: note: expected '_GLUfuncptr' {aka 'void (*)(void)'} but argument is of type 'void (*)(GLenum)' {aka 'void (*)(unsigned int)'} 336 | GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); | ~~~~~~~~~~~~^~~~~~~~~~~~ ex_angle.c:115:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 115 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} /usr/include/GL/glu.h:336:87: note: expected '_GLUfuncptr' {aka 'void (*)(void)'} but argument is of type 'void (*)(const GLdouble *)' {aka 'void (*)(const double *)'} 336 | GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); | ~~~~~~~~~~~~^~~~~~~~~~~~ ex_angle.c: In function 'draw_angle_style_back_cap': ex_angle.c:193:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 193 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} ex_angle.c:194:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 194 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} ex_raw.c: In function 'draw_raw_style_end_cap': ex_raw.c:152:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 152 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} from ex_raw.c:28: ex_raw.c:153:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 153 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} ex_raw.c: In function 'draw_front_contour_cap': ex_raw.c:212:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 212 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} ex_raw.c:213:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 213 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} ex_raw.c: In function 'draw_back_contour_cap': ex_raw.c:258:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 258 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} ex_raw.c:259:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 259 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} ex_cut_round.c: In function 'draw_cut_style_cap_callback': ex_cut_round.c:135:38: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 135 | gluTessCallback (tobj, GLU_BEGIN, glBegin); | ^~~~~~~ | | | void (*)(GLenum) {aka void (*)(unsigned int)} from ex_cut_round.c:30: ex_cut_round.c:136:39: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types] 136 | gluTessCallback (tobj, GLU_VERTEX, glVertex3dv); | ^~~~~~~~~~~ | | | void (*)(const GLdouble *) {aka void (*)(const double *)} from ex_alpha.c:16: See the meta bug#1220571 for more info.
Iff my interpreatation of *Microsoft* and *IBM* documentation on GLU (not GLE) is right, then gluTessCallback was originally defined as: void gluTessCallback(GLUtesselator *tess, GLenum which, void (*fn)()); i.e. a function pointer with _unspecified_ arguments. However, as C evolved: C11(ISO/IEC 9899:201x) §6.11.6 Function declarators The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature. And now somone made a modification to the glu source code, cf. commit 03ac87fa675e753aa2ff698c526c8f146f6c6490. This change is questionable, because now, it explicitly makes the callback be a 0-argument function rather than an unspecified-argument function. The practical solution, in my opinion, is for gluTessCallback to take a hint from dlsym, which returns function pointers as object pointers actually. In other words, glu should use void gluTessCallback(GLUtesselator *tess, GLenum which, void *fn);
Here now means 13 years ago. ;-) Just as reference. commit 03ac87fa675e753aa2ff698c526c8f146f6c6490 Author: zhigang gong <zhigang.gong@gmail.com> Date: Thu May 12 11:36:59 2011 +0100 glu: Fix _GLUfuncptr typedef. typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning: function declaration isn't a prototype. Signed-off-by: José Fonseca <jfonseca@vmware.com> diff --git a/include/GL/glu.h b/include/GL/glu.h index cd967ac..ba2228d 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -284,7 +284,7 @@ typedef GLUtesselator GLUtriangulatorObj; #define GLU_TESS_MAX_COORD 1.0e150 /* Internal convenience typedefs */ -typedef void (GLAPIENTRYP _GLUfuncptr)(); +typedef void (GLAPIENTRYP _GLUfuncptr)(void); GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
Ok. Could you make a submitrequest for glu package, please? Best would be to discuss this also upstream. https://gitlab.freedesktop.org/mesa/glu/-/issues
gle-3.1.2, released last year, addresses this already
rq1163394 to factory