dolik-rce / pegof

PEG grammar optimizer and formatter
Other
9 stars 2 forks source link

build failed on macOS #17

Closed leleliu008 closed 1 month ago

leleliu008 commented 1 month ago
FAILED: CMakeFiles/pegof.dir/src/checker.cc.o 
/Users/fpliu/.ppkg/core/wrapper-target-c++  -I/Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/src/src -I/Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/src/packcc/src -I/Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/src/_ -I/Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/include  -DNDEBUG   -Os  -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-sign-compare -Werror -MD -MT CMakeFiles/pegof.dir/src/checker.cc.o -MF CMakeFiles/pegof.dir/src/checker.cc.o.d -o CMakeFiles/pegof.dir/src/checker.cc.o -c /Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/src/src/checker.cc
/Users/fpliu/.ppkg/run/23760/macos-14.4.1-arm64/pegof/src/src/checker.cc:178:18: error: 'vsprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead. [-Werror,-Wdeprecated-declarations]
        result = vsprintf(buffer, format, args);
                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/stdio.h:199:1: note: 'vsprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 error generated.
dolik-rce commented 1 month ago

Hi @leleliu008,

thank you for your report. Pegof doesn't currently officially support any other platforms than Linux. However, since this might affect security on all platforms, I have fixed the problem. The commit (https://github.com/dolik-rce/pegof/commit/06de1f60104b85f61c196aba8c349b2137f146e2) is currently on the devel branch, let me if it fixes the build for you (I don't have mac hardware to test and don't have time to setup virtualization/github actions/...). I will merge it to master in next few days.

leleliu008 commented 1 month ago

@dolik-rce The commit (https://github.com/dolik-rce/pegof/commit/06de1f60104b85f61c196aba8c349b2137f146e2) fixed the problem.

leleliu008 commented 1 month ago

@dolik-rce Due to @masatake have a big interest in this tool and he introduced this tool into uctags via PR, I'd try to make this tool usable on GNU/Linux, macOS, FreeBSD, NetBSD, OpenBSD, etc.

dolik-rce commented 1 month ago

@leleliu008: The help is most welcome. I've noticed that you have already started fixing things in your fork. Feel free to send PRs, I'd really like to make pegof truly multi-platform, I just didn't have the time to support other platforms.