Closed frederic-mahe closed 1 year ago
I have fixed those warnings in the latest commits.
For the first issue, I used (void) vp
to avoid the warning. It simply references the variable and does nothing. This argument is mandatory for thread creation with the pthread_create
function.
For the second issue, I simply removed the apostrophes. This is as a non-standard feature. I think it only applies in some locales (e.g. US), so that's maybe the reason why you didn't see it. Adding commas or spaces between the thousands makes parsing harder, but human reading more difficult. However, I think it is better to avoid it.
Perfect! Thanks Torbjørn
In the dev
branch, default compilation options are now -Wall -Wextra -Wpedantic
, which is an excellent basis.
As of now,
vsearch
is compiled with the following checks-std=c++11 -Wall -Wsign-compare
. To prepare for future refactoring, it would be nice to activate more compilation options, as done withswarm
.I've been fixing warnings reported by
-Wextra
(mostly unused function parameters), but one case is resisting:Parameter
vp
is not used in the body ofdust_all_worker()
, but it seems to be necessary as that function is called asvoid *(*start_routine)(void *)
(pointer to a function that takes a void pointer parameter and returns a void pointer):I don't know how to fix that one (besides using
[[gnu::unused]]
).(note that
-Wsign-compare
is included in-Wextra
)Also,
-Wpedantic
returns a series of warning regarding the%'
flag in thefprintf
function. That flag is not a standard flag in C or C++, and I am not really sure what to do with it:I assume the goal is to nicely format long integers, but that does not seem to work on my machine: