Fixing cgit/Git compilation error with GCC 15

Today I was trying to compile and install cgit on my home server. cgit is a "hyperfast web frontend for git repositories written in C". When attempting to compile a got the following...