[Libwebsockets] -Wall -Werror -Wextra enabled on lws builds

Andy Green andy at warmcat.com
Mon Jun 28 16:41:47 CEST 2021


Hi -

I enabled -Wextra (with one override, -Wno-unused-parameter) on main 
today, since the big work earlier in the year to support -Wconversion 
-Wsign-compare had already done the heavy lifting, it only required a 
few fixes around oldstyle array definitions that had been leaving some 
members left implied.

-Wunused-parameter is part of -Wextra, but it complains about things 
that I don't think are reasonable, for example we may have a function 
template and implementations that vary by platform or, eg, tls library 
backend.  Some implementations of particular functions do not need 
parameters that others do, but we have to define the api to provide 
anything that any implementation needs.  The implementations that don't 
reference parameters can be "fixed" by force-referencing the unused 
params with (void) casts, but I don't see adding all that mush actually 
achieves anything positive.  So I turned that specific one off.

Since we already build with -Wall and unusually -Werror, adding -Wextra 
is a pretty significant milestone, despite it did not need huge changes.

It passes all the build platforms and scenarios in Sai, now over 500 
builds on 27 platforms.  That covers most common toolchains, but judging 
from the -Wconversion changes, there will be a handful of less common 
toolchains that find new things to complain about and need fixing up.

-Andy


More information about the Libwebsockets mailing list