Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gzdoom does not compile with gcc 13 #1992

Closed
1 task done
costel78 opened this issue Feb 5, 2023 · 4 comments
Closed
1 task done

Gzdoom does not compile with gcc 13 #1992

costel78 opened this issue Feb 5, 2023 · 4 comments
Labels

Comments

@costel78
Copy link

costel78 commented Feb 5, 2023

GZDoom version

No response

Which game are you running with GZDoom?

Doom 2

What Operating System are you using?

Linux x86_64

Please describe your specific OS version

Gentoo Linux

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

gzdoom 4.10.0 does not compile with gcc 13. Of course, gcc 13 is not released yet.
The issue is a missing include.
Proposed patch:
--- a/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h.orig 2023-02-03 11:34:29.412152601 +0200
+++ b/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h 2023-02-03 11:34:46.549675907 +0200
@@ -20,6 +20,7 @@
// THE SOFTWARE.
//

+#include
#ifndef AMD_VULKAN_MEMORY_ALLOCATOR_H
#define AMD_VULKAN_MEMORY_ALLOCATOR_H

Steps to reproduce the behaviour.

Explain how to reproduce
1.
2.
3.

Your configuration

No response

Provide a Log

Compilation fails with:
In file included from /var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.cpp:8:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h: In function ‘void VmaUint32ToStr(char*, size_t, uint32_t)’:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2410:9: error: ‘snprintf’ was not declared in this scope
2410 | snprintf(outStr, strLen, "%u", static_cast(num));
| ^~~~~~~~
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2262:1: note: ‘snprintf’ is defined in header ‘’; did you forget to ‘#include ’?
2261 | #include
+++ |+#include
2262 |
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h: In function ‘void VmaUint64ToStr(char*, size_t, uint64_t)’:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2414:9: error: ‘snprintf’ was not declared in this scope
2414 | snprintf(outStr, strLen, "%llu", static_cast(num));
| ^~~~~~~~
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2414:9: note: ‘snprintf’ is defined in header ‘’; did you forget to ‘#include ’?
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h: In function ‘void VmaPtrToStr(char*, size_t, const void*)’:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2418:9: error: ‘snprintf’ was not declared in this scope
2418 | snprintf(outStr, strLen, "%p", ptr);
| ^~~~~~~~
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:2418:9: note: ‘snprintf’ is defined in header ‘’; did you forget to ‘#include ’?
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h: In member function ‘virtual bool VmaBlockMetadata_Generic::Validate() const’:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:7561:40: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
7561 | VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
| ^
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:4938:38: note: in definition of macro ‘VMA_VALIDATE’
4938 | #define VMA_VALIDATE(cond) do { if(!(cond)) {
| ^~~~
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h: In member function ‘bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress(uint32_t, uint32_t, VkDeviceSize, VkDeviceSize, VkDeviceSize, VmaSuballocationType, bool, uint32_t, VmaAllocationRequest*)’:
/var/tmp/portage/games-fps/gzdoom-4.10.0/work/gzdoom-g4.10.0/src/common/rendering/vulkan/thirdparty/vk_mem_alloc/vk_mem_alloc.h:9436:25: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
9436 | if(resultOffset < VMA_DEBUG_MARGIN)
| ^

@costel78 costel78 added the bug label Feb 5, 2023
@costel78
Copy link
Author

costel78 commented Feb 5, 2023

gcc13.patch.txt

Pasting didn't work as expected.

@coelckers
Copy link
Member

That patch is not good, because it modifies a file from a third party library.
In any case, it may be better to report it here: https://github.com/dpjudas/ZVulkan

@bhbuehler
Copy link

bhbuehler commented Aug 2, 2023

I was able to compile with gcc version 13.1.1 20230714 on ArchLinux (I wasn't aware of this bug at the time so did not take notes. Perhaps the cmake or make file specifies an older gcc version, but my mastery of makefile syntax is incomplete.) Is this still an active bug?
Edit: gzdoom build g4.11pre-222-g62f37079a

@costel78
Copy link
Author

costel78 commented Aug 3, 2023

I recompiled it without the patch and it succeed. It seems that the issue is gone.
The bug can be closed.

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

No branches or pull requests

4 participants