-
-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change parts of `zuo.c` to avoid warnings that show up with flags like -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wshadow -Wpointer-arith -Wcast-qual -pedantic -O2 -std=c11 Repair a bug in Windows for `fd-poll` that better testing exposed, but also update test and docs to clarify that `fd-poll` is not so useful on Windows.
- Loading branch information
Showing
8 changed files
with
276 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
REM Find Visual Studio [Express] in one of the usual places. | ||
REM Expects something like "x86", "amd64", or "x86_amd64" as an argument. | ||
|
||
set VCMODE=%1 | ||
|
||
REM For 2022 and later, look in "Program Files" | ||
set Applications=%ProgramFiles% | ||
|
||
set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat | ||
|
||
REM For 2019 and earlier, look in "Program Files (x86)" | ||
set Applications=%ProgramFiles(x86)% | ||
if "%Applications%" == "" set Applications=%ProgramFiles% | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | ||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 14.0\vc\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 13.0\vc\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 12.0\vc\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 11.0\vc\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 10.0\vc\vcvarsall.bat | ||
|
||
if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio 9.0\vc\vcvarsall.bat | ||
|
||
"%VCVARBAT%" %VCMODE% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
name: Zuo with Strict Compiler Flags | ||
|
||
# yamllint disable-line rule:truthy | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-gcc: | ||
runs-on: ubuntu-22.04 | ||
|
||
env: | ||
CFLAGS: "-Werror -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wshadow -Wpointer-arith -Wcast-qual -pedantic -O2 -std=c11 -D_POSIX_C_SOURCE=200809L" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
- name: Compile | ||
run: | | ||
gcc -c $CFLAGS -DZUO_EMBEDDED zuo.c -o zuo_embed.o | ||
gcc $CFLAGS zuo.c -o zuo | ||
- name: Check | ||
run: ./zuo build.zuo check | ||
|
||
build-msvc: | ||
runs-on: windows-2022 | ||
|
||
env: | ||
CFLAGS: "/W1 /WX" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
- name: Compile | ||
shell: cmd | ||
run: | | ||
call .github\scripts\msvcprep.bat x86_amd64 | ||
cl /c %CFLAGS% /DZUO_EMBEDDED /Fo:zuo_embed.obj zuo.c | ||
cl %CFLAGS% zuo.c -o zuo | ||
- name: Check | ||
shell: cmd | ||
run: | | ||
call .github\scripts\msvcprep.bat x86_amd64 | ||
zuo build.zuo check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.