Skip to content

Commit

Permalink
compile with strict flags
Browse files Browse the repository at this point in the history
-Wall -Wextra -Werror -pedantic
Also passing in -Wno-unused-parameter because there are a lot of unused parameters, but (void) variable might not be desirable

xddfunc_numactl is now surrounded by HAVE_CPU_SET_T instead of HAVE_ENABLE_NUMA
  • Loading branch information
calccrypto committed Mar 20, 2024
1 parent 0b1aaab commit ffb3d5a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
name: build

runs-on: ubuntu-latest
env:
CFLAGS: -Wall -Wextra -Werror -pedantic -Wno-unused-parameter
strategy:
matrix:
img: ["ubuntu:20.04", "ubuntu:22.04", "centos:8" ]
Expand Down
4 changes: 1 addition & 3 deletions src/client/info_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ xdd_target_info(FILE *out, target_data_t *tdp) {
//ptds_t *masterp, *slavep;
//lockstep_t *master_lsp, *slave_lsp;
xint_data_pattern_t *dpp;
unsigned int j;

fprintf(out,"\tTarget number, %d\n",tdp->td_target_number);
fprintf(out,"\t\tFully qualified target pathname, '%s'\n",tdp->td_target_full_pathname);
fprintf(out,"\t\tTarget directory, %s\n",(strlen(tdp->td_target_directory)==0)?"\"./\"":tdp->td_target_directory);
Expand All @@ -151,7 +149,7 @@ xdd_target_info(FILE *out, target_data_t *tdp) {
#if HAVE_CPU_SET_T
if (strlen(tdp->numa_node_list) > 0) {
fprintf(out, "\t\tWorker threads pinned in NUMA domains, ");
for (j = 0; j < strlen(tdp->numa_node_list); j++) {
for (size_t j = 0; j < strlen(tdp->numa_node_list); j++) {
if (j != strlen(tdp->numa_node_list) - 1)
fprintf(out, "%c, ", tdp->numa_node_list[j]);
else
Expand Down
4 changes: 2 additions & 2 deletions src/client/parse_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,7 @@ xddfunc_noproclock(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags
xgp->global_options |= GO_NOPROCLOCK;
return(1);
}
#if HAVE_ENABLE_NUMA
#if HAVE_CPU_SET_T
/*----------------------------------------------------------------------------*/
// Specify the NUMA domain to pin worker threads of a particular target
// Arguments: -numactl [target #] #[,#]*
Expand Down Expand Up @@ -2355,7 +2355,7 @@ xddfunc_numactl(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags)
return(2);
}
}
#endif /* HAVE_ENABLE_NUMA */
#endif /* HAVE_CPU_SET_T */
/*----------------------------------------------------------------------------*/
// Specify the number of requests to run
// Arguments: -numreqs [target #] #
Expand Down
2 changes: 1 addition & 1 deletion src/client/parse_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ xdd_func_t xdd_func[] = {
{" Will set not lock process into memory\n",
0,0,0,0},
0},
#if HAVE_ENABLE_NUMA
#if HAVE_CPU_SET_T
{"numactl", "numa",
xddfunc_numactl,
1,
Expand Down
1 change: 1 addition & 0 deletions src/client/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ xdd_random_int(void) {

#if HAVE_RANDOM
return random();
#endif
#elif HAVE_RAND
return rand();
#endif
Expand Down

0 comments on commit ffb3d5a

Please sign in to comment.