Compile error with GCC 13
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 122
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
uname -a
Linux 281b889092aa 5.14.21-150500.55.65_13.0.74-cray_shasta_c_64k #1 SMP Mon Sep 9 09:48:48 UTC 2024 (ba86e71) aarch64 aarch64 aarch64 GNU/Linux
Issue 1:
testutil.c:22:12: error: static declaration of 'asprintf' follows non-static declaration
Adding #define _GNU_SOURCE seems solved the issue.
Issue 2:
The intentional double-fclose ‘bug’ now appears to be caught at compile time. We may want to remove it, or at least keep it only for older compilers.
t/std/fopen-fclose.c:102:10: error: pointer 'fd' used after 'fclose' [-Werror=use-after-free]
Similarly, in some other test code, we intentionally perform operations on closed file descriptors, but they are now flagged as compile-time errors.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the GCC 13 build errors in testutil.c and t/std/fopen-fclose.c on the reported Ubuntu environment. Review the other test code that performs operations on closed file descriptors, then ensure the affected tests compile without the reported diagnostics while preserving coverage of older compiler behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100