View Issue Details

IDProjectCategoryView StatusLast Update
0006495unrealircdpublic2025-02-10 11:57
Reportersyzop Assigned Tosyzop  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Version6.1.10-rc1 
Summary0006495: Specify C standard (-std=xxx) or gcc-15 will error
DescriptionIt was reported on IRC that upcoming GCC 15 fails to compile current UnrealIRCd. That's because it uses the C23 standard by default and UnrealIRCd's code is not C23 conformant. For a very long time we used C89 and nowadays we are ok with C99.

Making it C23 conformant is not something I want to do during the UnrealIRCd 6 stable series, it would mean all the hooks and everything need to be changed. I already decided that whenever work on UnrealIRCd 7 is started we will choose a more modern standard. And then I don't mean "a modern standard that accepts our code" but also like actually use modern features so making the more modern standard a minimum required version. No idea if the standard we will pick will be C23 or some other standard, though.

In the meantime, in UnrealIRCd 6 we will need to use -std=xxx in CFLAGS and select a specific version. We have two options on how to do that:
1) specify some -std=xxx always; or
2) via a configure check on a "when needed" basis. Eg when it errors on functions that had no parameters declared, the thing it bails on.

Always specifying the standard (option 1) is probably a good idea so you know things are consistent across platforms. UnrealIRCd itself compiles all the way down to gnu99 and even gnu89. However, there are probably 3rd party modules that (often unknowingly) require some newer standard. So if I force it at gnu99 they would not be happy. If I force it at gnu11 some may still not be happy. And if i use gnu17 then it will likely be a "too recent" requirement in compiler sense (eg clang 11 switched to gnu17 by default and is from october 2020).

I'm leaning towards option 2 for now. And otherwise option 1 with gnu11, which would require a compiler from 2017+ or so but, like i said, i don't really like introducing new compiler requirements during a stable release series. I am always very careful with that, or try to anyway.
TagsNo tags attached.
3rd party modules

Activities

syzop

2025-02-10 11:43

administrator   ~0023423

Fixed in https://github.com/unrealircd/unrealircd/commit/72af36d2a34cc75b0879c7e291a52f017a06ad08
See above for the reasoning.

commit 72af36d2a34cc75b0879c7e291a52f017a06ad08 (HEAD -> unreal60_dev, origin/unreal60_dev, origin/HEAD)
Author: Bram Matthys <[email protected]>
Date: Mon Feb 10 11:26:34 2025 +0100

    Fix problem with upcoming GCC 15 that assumes C23.
    GCC 15 is not released yet and is scheduled for April/May 2025.
    
    We now have a ./configure check. If a func() declaration is interpreted
    as meaning 0 arguments, so C23 style, then we now add -std=gnu17 to
    CFLAGS. If not, then we don't set an explicit C standard version.
    
    Closes https://bugs.unrealircd.org/view.php?id=6495

syzop

2025-02-10 11:57

administrator   ~0023424

Confirmed to work:
* Tested myself with gcc 14.1 with CFLAGS="-std=gnu23" ./Config -quick
* Someone else tested with gcc 15

Issue History

Date Modified Username Field Change
2025-02-10 10:42 syzop New Issue
2025-02-10 10:42 syzop Assigned To => syzop
2025-02-10 10:42 syzop Status new => confirmed
2025-02-10 11:43 syzop Note Added: 0023423
2025-02-10 11:57 syzop Status confirmed => resolved
2025-02-10 11:57 syzop Resolution open => fixed
2025-02-10 11:57 syzop Fixed in Version => 6.1.10-rc1
2025-02-10 11:57 syzop Note Added: 0023424