enable -Werror option (#631)

* enable -Werror option, set sprintf format

* change buffer size

* fix syntax error

* enable /WX option for MSVC
This commit is contained in:
Roman Fomin 2022-06-27 16:23:02 +07:00 committed by GitHub
parent bcf5410d3d
commit 5e9eb7434e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ jobs:
- name: Configure - name: Configure
env: env:
CC: ${{ matrix.compiler }} CC: ${{ matrix.compiler }}
run: cmake -B build -G "Ninja" run: cmake -B build -G "Ninja" -DENABLE_WERROR=ON
- name: Build - name: Build
run: cmake --build build run: cmake --build build
@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure - name: Configure
run: cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release run: cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON
- name: Build - name: Build
run: cmake --build build run: cmake --build build
@ -100,7 +100,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure - name: Configure
run: cmake -B build -T v141_xp -A Win32 run: cmake -B build -T v141_xp -A Win32 -DENABLE_WERROR=ON
- name: Build - name: Build
shell: bash shell: bash

View File

@ -40,9 +40,6 @@ if(MSVC)
# Default warning setting for MSVC. # Default warning setting for MSVC.
_checked_add_compile_option(/W3) _checked_add_compile_option(/W3)
# Treat all warnings as errors.
_checked_add_compile_option(/WX)
# Extra warnings for cl.exe. # Extra warnings for cl.exe.
_checked_add_compile_option(/we4013) # Implicit function declaration. _checked_add_compile_option(/we4013) # Implicit function declaration.
_checked_add_compile_option(/we4133) # Incompatible types. _checked_add_compile_option(/we4133) # Incompatible types.
@ -67,6 +64,9 @@ endif()
option(ENABLE_WERROR "Treat warnings as errors" OFF) option(ENABLE_WERROR "Treat warnings as errors" OFF)
if(ENABLE_WERROR) if(ENABLE_WERROR)
_checked_add_compile_option(-Werror) _checked_add_compile_option(-Werror)
if(MSVC)
_checked_add_compile_option(/WX)
endif()
endif() endif()
if(${FORCE_COLORED_OUTPUT}) if(${FORCE_COLORED_OUTPUT})

View File

@ -1931,7 +1931,7 @@ void WI_Ticker(void)
void WI_DrawBackground(void) void WI_DrawBackground(void)
{ {
char name[9]; char name[32];
if (state != StatCount && enterpic) if (state != StatCount && enterpic)
strcpy(name, enterpic); strcpy(name, enterpic);