Instead use make(1) env MAKEFLAGS set to `-w -O`.
With silent rules we don't see compile commands and only see a error
messages. This is beautiful when there is no errors but harder to
understand the cause when there are errors.
For example, after adding `-Wno-error=unused-but-set-variable`
I still see the error:
CXX genesys/libgenesys_la-device.lo
genesys/genesys.cpp:843:19: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
843 | for (unsigned i = 0;; ++i) {
| ^
But why? Hard to tell since we don't see compile command line.
With `-w -O` we see each compilation job grouped in the log.
This will help to debug build issues in CI, where reproduction is
costly/harder for a casual contributor. Compilation command is just
above the error. Find errors in log by searching for `error:` or
`warning:` strings.
clang 17 warnings that need to be fixed:
hp-option.c:3812:10: error: variable 'errcount' set but not used [-Werror,-Wunused-but-set-variable]
3812 | int i, errcount = 0;
| ^
In file included from hp3900.c:59:
./hp3900_sane.c:1755:12: error: variable 'nline' set but not used [-Werror,-Wunused-but-set-variable]
1755 | SANE_Int nline = 0;
| ^
lexmark_low.c:2500:7: error: variable 'blackLineCount' set but not used [-Werror,-Wunused-but-set-variable]
2500 | int blackLineCount = 0;
| ^
In file included from plustek_pp.c:124:
./plustek-pp_io.c:425:8: error: variable 'dwTime' set but not used [-Werror,-Wunused-but-set-variable]
425 | ULong dwTime = 1;
| ^
genesys/genesys.cpp:843:19: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
843 | for (unsigned i = 0;; ++i) {
| ^
After fixing them this commit could be reversed.
GCC 13 error message:
kodakaio.c: In function 'k_init_parametersta':
kodakaio.c:1830:67: error: unpaired UTF-8 bidirectional control character detected [-Werror=bidi-chars=]
1830 | * The default color depth is stored in mode_params.depth:<U+202D>
| ~~~~~~~~^
| | |
| | end of bidirectional context
| U+202D (LEFT-TO-RIGHT OVERRIDE)
Fixes: 06fae3526 ("kodakaio params.depth corrected for lineart, color mode made the default.")
When repos are forked on GitLab tags aren't copied (0 Tags) thus making
git-version-gen producing incorrect version ("UNKNOWN") which in turn
causes CI build failures (not helpful for people trying to make Merge
Requests). To workaround this issue reconstruct version from ChangeLogs
files (handy updated on every release). If git describe is not working
and we are not in dist package - take version from the top-most
ChangeLog file.
Example of error messages:
../libtool: line 1168: UNKNOWN + : syntax error: operand expected (error token is "+ ")
In file included from net.c:83:
net.c: In function 'connect_dev':
<command-line>: error: 'UNKNOWN' undeclared (first use in this function)
../include/sane/sane.h:31:21: note: in definition of macro 'SANE_VERSION_CODE'
31 | ( (((SANE_Word) (major) & 0xff) << 24) \
| ^~~~~
net.c:485:41: note: in expansion of macro 'V_MAJOR'
485 | req.version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR,
| ^~~~~~~
It's confirmed that neither Alpine nor Musl will fix ioctl warnings[1]
that making alpine build to fail and that these warnings are
harmless[2].
sanei_usb.c:4042:34: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '3221771554' to '-1073195742' [-Werror=overflow]
4042 | if (ioctl (devices[dn].fd, SCANNER_IOCTL_CTRLMSG, &c) < 0)
| ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/7580
Link: https://www.openwall.com/lists/musl/2020/01/20/3
Some xerox_mfp scanners, such as Samsung SCX-4521F, hangs when
their OUT ENDPOINT receives CLEAR HALT command, which is performed
in usb open and close functions of the backend.
The issue seem to be dependant on USB controller and assumingly
happens due to some sort of incompatibility of USB implementation
in the scanner.
Skip sending this command by default and add
SANE_XEROX_USB_HALT_WORKAROUND env variable to execute
CLEAR HALT commands.