Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.72k stars 214 forks source link

compile errors on Fedora38 using gcc 13.0.1 #688

Closed j4reporting closed 1 year ago

j4reporting commented 1 year ago

Upgraded fedora from from 37 to 38, and now I see this errors

ninja: Entering directory `build'
[1/61] Compiling C object vkquake.p/Quake_gl_warp.c.o
[2/61] Compiling C object vkquake.p/Quake_host.c.o
[3/61] Compiling C object vkquake.p/Quake_in_sdl.c.o
[4/61] Compiling C object vkquake.p/Quake_gl_heap.c.o
FAILED: vkquake.p/Quake_gl_heap.c.o 
cc -Ivkquake.p -I. -I.. -I/usr/include/SDL2 -I/usr/include/opus -fdiagnostics-color=always -fpch-preprocess -include quakedef.h -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu11 -O3 -D_REENTRANT -pthread -Wall -Wno-trigraphs -Wno-unused-function -Werror -DUSE_CODEC_WAVE -DUSE_CODEC_MP3 -DUSE_CODEC_FLAC -DUSE_CODEC_VORBIS -DUSE_CODEC_OPUS -MD -MQ vkquake.p/Quake_gl_heap.c.o -MF vkquake.p/Quake_gl_heap.c.o.d -o vkquake.p/Quake_gl_heap.c.o -c ../Quake/gl_heap.c
In function ‘GL_HeapAllocateFromSegment’,
    inlined from ‘GL_HeapAllocate’ at ../Quake/gl_heap.c:676:29:
../Quake/gl_heap.c:492:25: error: ‘alloc_info.small_alloc_size’ may be used uninitialized [-Werror=maybe-uninitialized]
  492 |                         GL_HeapSmallAllocateFromBlock (allocation, heap, segment, page_index, alloc_info->small_alloc_size, alloc_info->small_alloc_bucket);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Quake/gl_heap.c: In function ‘GL_HeapAllocate’:
../Quake/gl_heap.c:648:44: note: ‘alloc_info.small_alloc_size’ was declared here
  648 |                 allocinfo_t                alloc_info;
      |                                            ^~~~~~~~~~
In file included from ../Quake/q_stdinc.h:68,
                 from ../Quake/quakedef.h:78:
In function ‘GL_HeapAllocateFromSegment’,
    inlined from ‘GL_HeapAllocate’ at ../Quake/gl_heap.c:676:29:
../Quake/gl_heap.c:480:17: error: ‘alloc_info.small_alloc_bucket’ may be used uninitialized [-Werror=maybe-uninitialized]
  480 |                 assert (alloc_info->small_alloc_bucket < NUM_SMALL_ALLOC_SIZES);
      |                 ^~~~~~
../Quake/gl_heap.c: In function ‘GL_HeapAllocate’:
../Quake/gl_heap.c:648:44: note: ‘alloc_info.small_alloc_bucket’ was declared here
  648 |                 allocinfo_t                alloc_info;
      |                                            ^~~~~~~~~~
In function ‘GL_HeapAllocateFromSegment’,
    inlined from ‘GL_HeapAllocate’ at ../Quake/gl_heap.c:676:29:
../Quake/gl_heap.c:501:21: error: ‘alloc_info.alloc_size_in_pages’ may be used uninitialized [-Werror=maybe-uninitialized]
  501 |                 if (GL_HeapAllocateBlockFromSegment (heap, segment, alloc_info, &page_index))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Quake/gl_heap.c: In function ‘GL_HeapAllocate’:
../Quake/gl_heap.c:648:44: note: ‘alloc_info.alloc_size_in_pages’ was declared here
  648 |                 allocinfo_t                alloc_info;
      |                                            ^~~~~~~~~~
In function ‘GL_HeapAllocateFromSegment’,
    inlined from ‘GL_HeapAllocate’ at ../Quake/gl_heap.c:676:29:
../Quake/gl_heap.c:501:21: error: ‘alloc_info.alignment_in_pages’ may be used uninitialized [-Werror=maybe-uninitialized]
  501 |                 if (GL_HeapAllocateBlockFromSegment (heap, segment, alloc_info, &page_index))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Quake/gl_heap.c: In function ‘GL_HeapAllocate’:
../Quake/gl_heap.c:648:44: note: ‘alloc_info.alignment_in_pages’ was declared here
  648 |                 allocinfo_t                alloc_info;
      |                                            ^~~~~~~~~~
In function ‘GL_HeapAllocateFromSegment’,
    inlined from ‘GL_HeapAllocate’ at ../Quake/gl_heap.c:676:29:
../Quake/gl_heap.c:501:21: error: ‘alloc_info.size_class’ may be used uninitialized [-Werror=maybe-uninitialized]
  501 |                 if (GL_HeapAllocateBlockFromSegment (heap, segment, alloc_info, &page_index))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Quake/gl_heap.c: In function ‘GL_HeapAllocate’:
../Quake/gl_heap.c:648:44: note: ‘alloc_info.size_class’ was declared here
  648 |                 allocinfo_t                alloc_info;
      |                                            ^~~~~~~~~~
cc1: all warnings being treated as errors

with -Wno-maybe-uninitialized

ninja: Entering directory `build_wnoerror'
[1/2] Compiling C object vkquake.p/Quake_sv_phys.c.o
FAILED: vkquake.p/Quake_sv_phys.c.o 
cc -Ivkquake.p -I. -I.. -I/usr/include/SDL2 -I/usr/include/opus -fdiagnostics-color=always -fpch-preprocess -include quakedef.h -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu11 -O3 -D_REENTRANT -pthread -Wall -Wno-trigraphs -Wno-unused-function -Wno-maybe-uninitialized -Werror -DUSE_CODEC_WAVE -DUSE_CODEC_MP3 -DUSE_CODEC_FLAC -DUSE_CODEC_VORBIS -DUSE_CODEC_OPUS -MD -MQ vkquake.p/Quake_sv_phys.c.o -MF vkquake.p/Quake_sv_phys.c.o.d -o vkquake.p/Quake_sv_phys.c.o -c ../Quake/sv_phys.c
../Quake/sv_phys.c: In function ‘SV_FlyMove’:
../Quake/sv_phys.c:267:53: error: ‘new_velocity[0]’ is used uninitialized [-Werror=uninitialized]
  267 |         vec3_t  primal_velocity, original_velocity, new_velocity;
      |                                                     ^~~~~~~~~~~~
../Quake/sv_phys.c:267:53: error: ‘new_velocity[1]’ is used uninitialized [-Werror=uninitialized]
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.

fedora 37: gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4) fedora 38: gcc (GCC) 13.0.1 20230401 (Red Hat 13.0.1-0)

Novum commented 1 year ago

Those are all not actual bugs, but I will shut up the compiler.

Novum commented 1 year ago

19d7658