Skip to content

Commit

Permalink
fix a few more warnings and enable warnings as errors for Windows and…
Browse files Browse the repository at this point in the history
… macOS
  • Loading branch information
bashbaug committed Aug 24, 2023
1 parent af1d3a6 commit f9e698f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
run: $CMAKE_EXE
-G "${{matrix.GEN}}"
-D CMAKE_BUILD_TYPE=${{matrix.CONFIG}}
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_COMPILER=g++-${{matrix.VER}}
-D CMAKE_CXX_STANDARD=${{matrix.STD}}
-D CMAKE_CXX_EXTENSIONS=${{matrix.EXT}}
Expand All @@ -140,7 +140,7 @@ jobs:
$CMAKE_EXE
-G "${{matrix.GEN}}"
-D CMAKE_BUILD_TYPE=${{matrix.CONFIG}}
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_COMPILER=g++-${{matrix.VER}}
-D CMAKE_CXX_STANDARD=${{matrix.STD}}
-D CMAKE_CXX_EXTENSIONS=${{matrix.EXT}}
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
shell: bash
run: $CMAKE_EXE
-G "${{matrix.GEN}}"
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_COMPILER=g++-${{matrix.VER}}
-D CMAKE_CXX_STANDARD=${{matrix.STD}}
-D CMAKE_CXX_EXTENSIONS=${{matrix.EXT}}
Expand All @@ -306,7 +306,7 @@ jobs:
echo -e "include(\"$GITHUB_WORKSPACE/external/OpenCL-Headers/install/share/cmake/OpenCLHeaders/OpenCLHeadersTargets.cmake\")\ninclude(\"$GITHUB_WORKSPACE/external/OpenCL-ICD-Loader/install/share/cmake/OpenCLICDLoader/OpenCLICDLoaderTargets.cmake\")\ninclude(\"\${CMAKE_CURRENT_LIST_DIR}/../OpenCLHeadersCpp/OpenCLHeadersCppTargets.cmake\")" > $GITHUB_WORKSPACE/install/share/cmake/OpenCL/OpenCLConfig.cmake ;
$CMAKE_EXE
-G "${{matrix.GEN}}"
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -m${{matrix.BIN}}"
-D CMAKE_CXX_COMPILER=g++-${{matrix.VER}}
-D CMAKE_CXX_STANDARD=${{matrix.STD}}
-D CMAKE_CXX_EXTENSIONS=${{matrix.EXT}}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,11 @@ jobs:
--parallel `sysctl -n hw.logicalcpu`

- name: Configure CMake
# no -Werror during configuration because:
# warning: ISO C forbids assignment between function pointer and ‘void *’ [-Wpedantic]
# warning: unused parameter [-Wunused-parameter]
shell: bash
run: cmake
-G "${{matrix.GEN}}"
-D BUILD_TESTING=ON
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Wno-format -m64"
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -Wno-format -m64"
-D CMAKE_CXX_COMPILER=/usr/local/bin/g++-${{matrix.VER}}
-D CMAKE_CXX_STANDARD=${{matrix.STD}}
-D CMAKE_CXX_EXTENSIONS=${{matrix.EXT}}
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,16 @@ jobs:
- name: Configure (MSBuild)
if: matrix.GEN == 'Visual Studio 17 2022'
shell: cmd
# no /WX during configuration because:
# warning C4459: declaration of 'platform' hides global declaration
# warning C4100: 'input_headers': unreferenced formal parameter
run: |
set C_FLAGS="/W4"
set C_FLAGS="/W4 /WX"
if /I "${{matrix.BIN}}"=="x86" (set BIN=Win32) else (set BIN=x64)
%CMAKE_EXE% -G "${{matrix.GEN}}" -A %BIN% -T ${{matrix.VER}} -D BUILD_TESTING=ON -D CMAKE_C_FLAGS=%C_FLAGS% -D CMAKE_C_STANDARD=${{matrix.STD}} -D CMAKE_C_EXTENSIONS=${{matrix.EXT}} -D CMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install -D CMAKE_PREFIX_PATH="%GITHUB_WORKSPACE%\external\OpenCL-Headers\install;%GITHUB_WORKSPACE%\external\OpenCL-ICD-Loader\install" -S %GITHUB_WORKSPACE% -B %GITHUB_WORKSPACE%\build
- name: Configure (Ninja Multi-Config)
if: matrix.GEN == 'Ninja Multi-Config'
shell: cmd
# no /WX during configuration because:
# warning C4459: declaration of 'platform' hides global declaration
# warning C4100: 'input_headers': unreferenced formal parameter
run: |
set C_FLAGS="/W4"
set C_FLAGS="/W4 /WX"
if /I "${{matrix.VER}}"=="v140" (set VER=14.0)
if /I "${{matrix.VER}}"=="v141" (set VER=14.1)
if /I "${{matrix.VER}}"=="v142" (set VER=14.2)
Expand Down
4 changes: 2 additions & 2 deletions include/CL/opencl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3202,10 +3202,10 @@ class Context
#if defined(cl_ext_image_requirements_info)
struct ImageRequirementsInfo {

ImageRequirementsInfo(cl_mem_flags f, const cl_mem_properties* properties, const ImageFormat* format, const cl_image_desc* desc)
ImageRequirementsInfo(cl_mem_flags f, const cl_mem_properties* p, const ImageFormat* format, const cl_image_desc* desc)
{
flags = f;
properties = properties;
properties = p;
image_format = format;
image_desc = desc;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/test_openclhpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@ static cl_mem clCreateBuffer_testBufferConstructorContextIterator(
(void) num_calls;

TEST_ASSERT_EQUAL_PTR(make_context(0), context);
TEST_ASSERT_BITS(CL_MEM_COPY_HOST_PTR, flags, !CL_MEM_COPY_HOST_PTR);
TEST_ASSERT_BITS(CL_MEM_READ_ONLY, flags, CL_MEM_READ_ONLY);
TEST_ASSERT_EQUAL_HEX(CL_MEM_READ_ONLY, flags);
TEST_ASSERT_EQUAL(sizeof(int)*1024, size);
TEST_ASSERT_NULL(host_ptr);
if (errcode_ret)
Expand Down

0 comments on commit f9e698f

Please sign in to comment.