Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

can't compile Trunk r8589 #1121

Closed
wzdev-ci opened this issue Nov 29, 2009 · 7 comments
Closed

can't compile Trunk r8589 #1121

wzdev-ci opened this issue Nov 29, 2009 · 7 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by jaakan


Mythbuntu 9.10 x64

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..  -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -I/usr/include/libpng12     -DDEBUG -DWZ_DATADIR="\"/usr/local/share/warzone2100\"" -DLOCALEDIR="\"/usr/local/share/locale\"" -I../..  -O0 -g -Wall -Werror -Wno-unused-label -Wno-pointer-to-int-cast -Wmissing-field-initializers -Wcast-align -Wwrite-strings -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wno-format-security -Wno-missing-declarations  -MT pieblitfunc.o -MD -MP -MF .deps/pieblitfunc.Tpo -c -o pieblitfunc.o pieblitfunc.c
cc1: warnings being treated as errors
pieblitfunc.c: In function ‘pie_ShutdownRadar’:
pieblitfunc.c:280: error: passing argument 2 of ‘glDeleteTextures’ from incompatible pointer type
/usr/include/GL/gl.h:1341: note: expected ‘const GLuint *’ but argument is of type ‘long unsigned int *’
make[3]: *** [pieblitfunc.o] Error 1
make[3]: Leaving directory `/home/jaakan/warzone/lib/ivis_opengl'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/jaakan/warzone/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jaakan/warzone'
make: *** [all] Error 2


Issue migrated from trac:1121 at 2022-04-15 20:08:21 -0700

@wzdev-ci
Copy link
Contributor Author

stiv commented


Similar issues with texture.c. Beware 32 vs 64 bit issues between different architectures.

texture.c:258: error: format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘long unsigned int’

texture.c:263: error: format ‘%u’ expects type ‘unsigned int’, but argument 8 has type ‘long unsigned int’

@wzdev-ci
Copy link
Contributor Author

stiv commented


Same story in 2.3 branch. 32 bit linux

../../../2.3/lib/ivis_opengl/pieblitfunc.c:280: error: passing argument 2 of ‘glDeleteTextures’ from incompatible pointer type

../../2.3/src/texture.c:253: error: format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘long unsigned int’

../../2.3/src/texture.c:258: error: format ‘%u’ expects type ‘unsigned int’, but argument 8 has type ‘long unsigned int’

@wzdev-ci
Copy link
Contributor Author

Zarel commented


Well, better to cast a long to an int, than an int ptr to a long ptr...

I'd like someone with Linux to go fix these errors, since we'd have to repeat this many times to get all of them. Stiv, can you write a patch?

@wzdev-ci
Copy link
Contributor Author

jaakan commented


I think changing

glDeleteTextures(1, &_TEX_PAGE[radarTexture].id);
to
glDeleteTextures(1, (GLuint *) &_TEX_PAGE[radarTexture].id);

takes care of pieblitfunc.c:280.... error

Would something like that fix the following?

texture.c:258: error: format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘long unsigned int’
texture.c:263: error: format ‘%u’ expects type ‘unsigned int’, but argument 8 has type ‘long unsigned int’

like

_TEX_PAGE[texPage].id 
to
(GLuint)_TEX_PAGE[texPage].id

in texture.c

these changes do help it to fully build again for me at least.

@wzdev-ci
Copy link
Contributor Author

Zarel changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Zarel set resolution to fixed

@wzdev-ci
Copy link
Contributor Author

Zarel commented


Fixed in [8590]/[8591].

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant