Commit e43e323
tl-parser: fix getenv/getopt prototypes for C23 compatibility
The vendored wgetopt.c/wgetopt.h use K&R-style empty-parameter
declarations (extern char *getenv(); / extern int getopt();).
Under C23 (GCC 15+ and Clang 16+ default), () means 'no parameters',
so calls with arguments are rejected as errors.
Fix by adding the correct prototypes:
wgetopt.c: extern char *getenv(const char *);
wgetopt.h: extern int getopt(int, char *const *, const char *);
Verified: wgetopt.c compiles without errors under -std=gnu23
with GCC 15.2 (MSYS2 MinGW64). No CMake changes needed.1 parent a9966eb commit e43e323
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments