-
Notifications
You must be signed in to change notification settings - Fork 169
Open
Description
src/tilda-lock-files.c uses popen from stdio.h:
Line 223 in 51bfe3c
| if ((ps_output = popen (ps_command, "r")) == NULL) { |
However, tilda seems to use C99 by default:
Lines 103 to 111 in 51bfe3c
| #Use C99 compilation mode | |
| if test "x$enable_clang" = "xyes"; then | |
| # clang uses c99 mode by default, so we just set CC to clang and we are done | |
| CC="clang"; | |
| else | |
| # We do not need to set CC as the default is gcc, but we need to set it to | |
| # use C99 compilation mode | |
| CFLAGS="$CFLAGS -std=c99"; | |
| fi |
And C99 doesn't enable POSIX extensions such as popen by default.
With GCC 13 and earlier, this would lead to the following warning:
src/tilda-lock-files.c:223:22: warning: implicit declaration of function 'popen'; did you mean 'open'? [-Wimplicit-function-declaration]
223 | if ((ps_output = popen (ps_command, "r")) == NULL) {
| ^~~~~
| openIt seems that starting with GCC 14, this warning is now an error.
src/tilda-lock-files.c:223:22: error: implicit declaration of function 'popen'; did you mean 'open'? [-Wimplicit-function-declaration]
223 | if ((ps_output = popen (ps_command, "r")) == NULL) {
| ^~~~~
| openMy understanding is that you should define _POSIX_C_SOURCE before importing stdio.h in tilda-lock-files.c or specify gnu99 instead of c99 in configure.ac.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels