Menu

#238 Conflicting declarations of variable forceOldBsp

v2.2.6.*
open
nobody
None
5
2014-06-10
2014-06-10
No

Hi,

During a rebuild of all Debian packages in a clean sid chroot (using cowbuilder
and pbuilder) the build failed with the following error. Please note that we
use our research compiler tool-chain (using tools from the cbmc package), which
permits extended reporting on type inconsistencies at link time.

[...]
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I../src -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wl,-z,relro -Wl,--as-needed -Wl,-z,defs -o prboom-plus am_map.o g_game.o p_mobj.o r_demo.o r_segs.o hu_lib.o lprintf.o p_plats.o r_sky.o d_deh.o hu_stuff.o m_argv.o p_pspr.o m_bbox.o p_saveg.o r_things.o d_items.o m_cheat.o p_setup.o s_sound.o d_main.o p_sight.o sounds.o m_menu.o p_spec.o info.o st_lib.o m_misc.o p_switch.o p_telept.o st_stuff.o m_random.o p_tick.o tables.o p_user.o p_ceilng.o v_video.o doomdef.o p_doors.o p_enemy.o r_bsp.o version.o doomstat.o p_floor.o r_data.o w_wad.o p_genlin.o dstrings.o p_inter.o wi_stuff.o r_draw.o f_finale.o p_lights.o z_bmalloc.o p_map.o r_main.o f_wipe.o z_zone.o p_maputl.o r_plane.o md5.o p_checksum.o r_patch.o r_fps.o r_filter.o e6y.o i_pcsound.o r_screenmultiply.o g_overflow.o hu_tracers.o s_advsound.o i_capture.o sc_man.o i_smp.o d_client.o gl_opengl.o gl_detail.o gl_main.o gl_texture.o gl_vertex.o gl_wipe.o gl_hires.o gl_clipper.o gl_gamma.o gl_missingtexture.o gl_light.o gl_hqresize.o gl_sky.o gl_fbo.o gl_shadow.o gl_soft2gl.o gl_map.o gl_preprocess.o gl_drawinfo.o gl_shader.o w_mmap.o memio.o mus2mid.o SDL/libsdldoom.a PCSOUND/libpcsound.a TEXTSCREEN/libtextscreen.a MUSIC/libdoommusic.a -lSDL_net -L/usr/lib/x86_64-linux-gnu -lSDL -lGL -lGLU -lpng -lSDL_image -lportmidi -lporttime -lvorbisfile -ldumb -lfluidsynth -lmad -lpcreposix -lSDL_mixer -lm
r_demo.o: In function G_ReadDemoFooter': /srv/jenkins-slave/workspace/sid-goto-cc-prboom-plus/prboom-plus-2.5.1.4~svn4384+dfsg1/src/r_demo.c:1091: warning: the use ofmktemp' is dangerous, better use mkstemp' ormkdtemp'

file p_setup.c line 104: error: conflicting types for variable "forceOldBsp"
old definition in module g_game file g_game.c line 2887
signed int
new definition in module p_setup file p_setup.c line 104
dboolean
Makefile:541: recipe for target 'prboom-plus' failed

As dboolean is an enum:

http://sources.debian.net/src/prboom-plus/2:2.5.1.4~svn4384+dfsg1-1/src/doomtype.h?hl=46#L46

there is no guarantee its storage size is the same as that of a signed int. Hence access may be misaligned on certain platforms. The fix is to declare forceOldBsp as dboolean throughout.

Best,
Michael

Discussion


Log in to post a comment.