Skip to content

Commit

Permalink
Add warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmywish committed Dec 27, 2024
1 parent 1ab8b7c commit 88141b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# Contributors : Yangmoooo <[email protected]>
# |
# Created On : <2023-08-28>
# Last Modified : <2024-12-14>
# Last Modified : <2024-12-27>
# --------------------------------------------------------------

CFLAGS = -Iinclude -Ilib # -Wall
CFLAGS += -Iinclude -Ilib # -Wall

# 只有Windows会定义该变量
ifeq ($(OS), Windows_NT)
Expand All @@ -22,13 +22,17 @@ ifeq ($(shell uname), Linux)
CFLAGS += -static
endif

override WARN += -Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation \
-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare
_C_Warning_Flags := $(WARN)

Target = chsrc

CI_Build_Name = chsrc
#=======================

all:
@$(CC) src/chsrc-main.c $(CFLAGS) -o $(Target)
@$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(Target)
@echo; echo Compile done using \'$(CC)\' $(CFLAGS)

CI: all
Expand Down
6 changes: 3 additions & 3 deletions src/framework/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ get_max_ele_idx_in_dbl_ary (double *array, int size)
void
measure_speed_for_every_source (Source_t sources[], int size, double speed_records[])
{
bool get_measured[size]; /* 是否真正执行了测速 */
// bool get_measured[size]; /* 是否真正执行了测速 */
int get_measured_n = 0; /* 测速了几个 */
char *measure_msgs[size];

Expand All @@ -587,7 +587,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor
speed = 0;

speed_records[i] = speed;
get_measured[i] = false;
// get_measured[i] = false;
measure_msgs[i] = NULL;
}

Expand All @@ -613,7 +613,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor
/* 不测速的 Provider */
speed = 0;
}
get_measured[i] = false;
// get_measured[i] = false;
speed_records[i] = speed;

const char *msg = CliOpt_InEnglish ? provider->abbr : provider->name;
Expand Down

0 comments on commit 88141b6

Please sign in to comment.