[sane-devel] [Janitorial] Zero(!) compiler warnings
Olaf Meeuwissen
paddy-hack at member.fsf.org
Thu Sep 22 12:00:15 UTC 2016
Hi Louis,
Louis Lagendijk writes:
> On Wed, 2016-09-21 at 22:12 +0900, Olaf Meeuwissen wrote:
>> Hi devs,
>>
>> About a year ago, I set out trying to get rid of *all* compiler
>> warnings
>> on a "well-defined" build platform.I'm happy to report that we've
>> made
>> it!With the commit of ee550e5d[1], the debian-8-full build[2], is
>> free
>> of compiler warnings!
>>
>> [1] https://gitlab.com/sane-project/backends/commit/ee550e5de8e63664
>> 2b9895d54f6740aa38ee6ff8
>> [2] https://gitlab.com/sane-project/backends/builds/4218963
>>
> well done, it is good to see things cleaned up. I am afraid that the
> "we" above is not correct. It was your work....Thanks a lot.
I tried writing "I've" but it sounded too pompous ;-)
>> The fedora-24-clang build[7]?Let's leave that for another
>> time.Much
>> of what you see there will pop up with gcc-6.x as well (which will be
>> in
>> Debian 9, rumoured to release sometime early next year, IIRC).
>>
> Fedora 24 already has a GCC 6.1. I did a quick compile and saw some 20
> odd warnings: some unused defines, some warnings like:
>
> magicolor.c: In function 'mc_scan_finish':
> magicolor.c:1291:2: warning: this 'if' clause does not guard... [-
> Wmisleading-indentation]
> if (status != SANE_STATUS_GOOD)
> ^~
> magicolor.c:1293:3: note: ...this statement, but the latter is
> misleadingly indented as if it is guarded by the 'if'
> return status;
> ^~~~~~
>
> I have not looked at these in more detail (I wish I had more time)
>
> Let me know if you want a log of the full compilation.
Thanks, but adding a Fedora gcc build should be very littly trouble.
Simply set the CC environment variable when using the fedora-24-clang
image should do the trick. I could add a builder that does that with
very little effort but wonder if it's worth to edit .gitlab-ci.yml and
keep the GitLab CI shared runners busy with those builds.
# I can also simply run a build locally using a fedora-24-clang image.
For now, though, I'd like to focus on debian-8-mini and alpine-3.4-mini
warnings. The gcc-6.x and clang-x.y warnings can wait as far as *I*'m
concerned but if you feel compelled to fix 'em, go ahead!
BTW, see
https://gitlab.com/sane-project/ci-envs
for more info on the images used by .gitlab-ci.yml.
Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
More information about the sane-devel
mailing list