mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.7k stars 705 forks source link

[BUG] Receiving `'vfork' is deprecated:` warnings while compiling Kakoune from source #5170

Closed VKondakoff closed 1 month ago

VKondakoff commented 1 month ago

Version of Kakoune

2024.05.09

Reproducer

  1. Clone https://github.com/mawww/kakoune.git
  2. cd to kakoune
  3. sudo make install

Outcome

c++   -I/opt/local/include  -std=c++2a -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-sign-compare -O3 -g3  -fsized-deallocation  -MD -MP -MF src/.shell_manager.opt.d -c -o src/shell_manager.opt.o src/shell_manager.cc
src/shell_manager.cc:118:21: warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
    if (pid_t pid = vfork())
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: note: 'vfork' has been explicitly marked deprecated here
__deprecated_msg("Use posix_spawn or fork")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
Снимок экрана 2024-05-09 в 13 45 03

Expectations

No warnings (in an ideal world). ;)

Additional information

MacOS 12.7.4, zsh, Apple clang version 14.0.0 (clang-1400.0.29.202) Target: x86_64-apple-darwin21.6.0 Thread model: posix

mawww commented 1 month ago

vfork is indeed deprecated according to POSIX but is a nice performance optimization on most platforms and the posix_spawn family of function is pretty bad as it enforces dynamic allocations for the file actions even though their number is statically known as compile time.

There might be a way to silence the warning but at the moment I do not intend to replace the uses of vfork.

VKondakoff commented 1 month ago

Thanks for the info. Closing the issue.