Skip to content

Commit

Permalink
Merge pull request #84 from thbeu/treat-warnings-as-errors
Browse files Browse the repository at this point in the history
CI: treat all warnings as errors
  • Loading branch information
rouault authored Jan 22, 2024
2 parents ad1886a + 29116cb commit f88d88f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
uses: actions/checkout@v4

- name: Configure (${{ matrix.configuration }})
run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON
run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON

- name: Build with ${{ matrix.compiler }}
run: cmake --build build
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ target_include_directories(${PACKAGE}
$<INSTALL_INTERFACE:include>
)

if(NOT MSVC)
if(MSVC)
target_compile_options(${PACKAGE} PRIVATE /W4)
else()
target_compile_options(${PACKAGE} PRIVATE -Wall -Wextra -pedantic)
endif()

Expand Down
8 changes: 4 additions & 4 deletions sbnsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ SBNSearchHandle SBNOpenDiskTree(const char *pszSBNFilename,
/* -------------------------------------------------------------------- */
/* Establish the byte order on this machine. */
/* -------------------------------------------------------------------- */
bool bBigEndian;
bool _bBigEndian;
{
int i = 1;
if (*REINTERPRET_CAST(unsigned char *, &i) == 1)
bBigEndian = false;
_bBigEndian = false;
else
bBigEndian = true;
_bBigEndian = true;
}

/* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -191,7 +191,7 @@ SBNSearchHandle SBNOpenDiskTree(const char *pszSBNFilename,
memcpy(&hSBN->dfMaxX, abyHeader + 48, 8);
memcpy(&hSBN->dfMaxY, abyHeader + 56, 8);

if (!bBigEndian)
if (!_bBigEndian)
{
SwapWord(8, &hSBN->dfMinX);
SwapWord(8, &hSBN->dfMinY);
Expand Down

0 comments on commit f88d88f

Please sign in to comment.