Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ jobs:
- name: Build x86
run: |
$env:PATH += ";C:\Program Files (x86)\GnuWin32\bin"
cmake -G "Visual Studio 17 2022" -A "win32" -B build32 -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Visual Studio 17 2022" -A "win32" -B build32 -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build build32 --target ALL_BUILD --config Debug
cmake --build build32 --target ALL_BUILD --config Release
- name: Build x64
run: |
$env:PATH += ";C:\Program Files (x86)\GnuWin32\bin"
cmake -G "Visual Studio 17 2022" -A "x64" -B build64 -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Visual Studio 17 2022" -A "x64" -B build64 -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build build64 --target ALL_BUILD --config Debug
cmake --build build64 --target ALL_BUILD --config Release
- name: Collect artifacts
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
apk add cmake g++ ninja m4 linux-headers
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF -DCMAKE_EXE_LINKER_FLAGS=-static
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON -DCMAKE_EXE_LINKER_FLAGS=-static
cmake --build .
mv ./tests/tests ./tests_linux_musl_x86_64
mv ./tests/tests_header_only ./tests_header_only_linux_musl_x86_64
Expand All @@ -127,7 +127,7 @@ jobs:
i386/alpine:3.23.3 sh -c '
apk add cmake g++ ninja m4 linux-headers &&
mkdir build && cd build &&
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF -DCMAKE_EXE_LINKER_FLAGS=-static &&
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON -DCMAKE_EXE_LINKER_FLAGS=-static &&
cmake --build . &&
mv ./tests/tests ./tests_linux_musl_x86 &&
mv ./tests/tests_header_only ./tests_header_only_linux_musl_x86
Expand All @@ -146,7 +146,7 @@ jobs:
- name: Build
run: |
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build .
mv ./tests/tests ./tests_linux_glibc_x86_64
mv ./tests/tests_header_only ./tests_header_only_linux_glibc_x86_64
Expand All @@ -169,7 +169,7 @@ jobs:
i386/debian:bookworm sh -c '
apt-get update && apt-get install -y cmake ninja-build g++ m4 &&
mkdir build && cd build &&
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF &&
cmake -G "Ninja" ../ -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON &&
cmake --build . &&
mv ./tests/tests ./tests_linux_glibc_x86 &&
mv ./tests/tests_header_only ./tests_header_only_linux_glibc_x86
Expand All @@ -189,7 +189,7 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x64_winxp.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x64_winxp.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build .
mv ./tests/tests.exe ./tests_mingw_x64_winxp.exe
mv ./tests/tests_header_only.exe ./tests_header_only_mingw_x64_winxp.exe
Expand All @@ -208,7 +208,7 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y gcc-mingw-w64-i686-posix g++-mingw-w64-i686-posix
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_winxp.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_winxp.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build .
mv ./tests/tests.exe ./tests_mingw_x86_winxp.exe
mv ./tests/tests_header_only.exe ./tests_header_only_mingw_x86_winxp.exe
Expand All @@ -228,7 +228,7 @@ jobs:
run: |
apk add cmake mingw-w64-gcc ninja m4
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x64_winblue.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x64_winblue.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build .
mv ./tests/tests.exe ./tests_mingw_x64_winblue.exe
mv ./tests/tests_header_only.exe ./tests_header_only_mingw_x64_winblue.exe
Expand All @@ -251,7 +251,7 @@ jobs:
i386/alpine:3.23.3 sh -c '
apk add cmake mingw-w64-gcc ninja m4 &&
mkdir build && cd build &&
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_winblue.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF &&
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_winblue.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON &&
cmake --build . &&
mv ./tests/tests.exe ./tests_mingw_x86_winblue.exe &&
mv ./tests/tests_header_only.exe ./tests_header_only_mingw_x86_winblue.exe
Expand All @@ -271,7 +271,7 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y gcc-mingw-w64-i686-posix g++-mingw-w64-i686-posix
mkdir build && cd build
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_win2k.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=OFF
cmake -G "Ninja" ../ -DCMAKE_TOOLCHAIN_FILE="../toolchain_mingw_x86_win2k.cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DTCS_ENABLE_TESTS=ON -DTCS_ENABLE_EXAMPLES=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build .
mv ./tests/tests.exe ./tests_mingw_x86_win2k.exe
mv ./tests/tests_header_only.exe ./tests_header_only_mingw_x86_win2k.exe
Expand Down
11 changes: 10 additions & 1 deletion include/tinycsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -3306,6 +3306,7 @@ TcsResult tcs_sendv(TcsSocket socket_ctx,
// buffer_count is already validated against UIO_MAXIOV above.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
msg.msg_iovlen = buffer_count;
#pragma GCC diagnostic pop
msg.msg_control = NULL;
Expand Down Expand Up @@ -4892,7 +4893,15 @@ TcsResult tcs_sendv(TcsSocket socket_ctx,
free(heap_buffers);
return TCS_ERROR_INVALID_ARGUMENT;
}
// WSABUF.buf is non-const by Windows API design, but WSASend does not modify the data.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
native_buffers[i].buf = (CHAR*)buffers[i].data;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
native_buffers[i].len = (ULONG)buffers[i].size;
}

Expand Down Expand Up @@ -7427,7 +7436,7 @@ TcsResult tcs_address_parse(const char str[], struct TcsAddress* out_address)
break;
}

ctx.state = next;
ctx.state = (uint8_t)next;
if (*c != '\0')
c++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tinycsocket_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ TcsResult tcs_address_parse(const char str[], struct TcsAddress* out_address)
break;
}

ctx.state = next;
ctx.state = (uint8_t)next;
if (*c != '\0')
c++;
}
Expand Down
1 change: 1 addition & 0 deletions src/tinycsocket_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ TcsResult tcs_sendv(TcsSocket socket_ctx,
// buffer_count is already validated against UIO_MAXIOV above.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
msg.msg_iovlen = buffer_count;
#pragma GCC diagnostic pop
msg.msg_control = NULL;
Expand Down
8 changes: 8 additions & 0 deletions src/tinycsocket_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,15 @@ TcsResult tcs_sendv(TcsSocket socket_ctx,
free(heap_buffers);
return TCS_ERROR_INVALID_ARGUMENT;
}
// WSABUF.buf is non-const by Windows API design, but WSASend does not modify the data.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
native_buffers[i].buf = (CHAR*)buffers[i].data;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
native_buffers[i].len = (ULONG)buffers[i].size;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ TEST_CASE("TdsList capacity hysteresis")
CHECK(tds_ulist_best_capacity_fit(64, 16) == 16);
}

TDS_ULIST_IMPL(int, int);
TDS_ULIST_IMPL(int, int)

TEST_CASE("TdsUList create / destroy")
{
Expand Down
Loading