Week 3 report on porting Gentoo packages to modern C

Hello all,

I’m here with my week 3 report for Modern C porting of Gentoo’s
packages. For this week I diverted from my initial idea a bit and
focused on the “C++17 does not allow register storage class specific” type
error. Basically, C++14 deprecated the register storage class and it has
been completely removed in C++17, thus resulting in C++ packages that
use register keywords with this kind of error. A general fix is it
either removes the keywords or replaces them with *int* where applicable.

For example, in this PR [1] for the fox toolkit, I’m using sed to remove
register keywords from various folders of the source. Whenever possible
I’m sending patches upstream as well, for example, I’ve sent this [2]
patch upstream while also applying it Gentoo tree.

Not to mention, I’ve been sticking to my proposal timeline as well and
patching -Wimplicit-int error [3][4][5] (Initially I planned on taking
up this particular bug type in the latter half of the week). But
sometimes the error messages are not that straightforward and can be
miss leading. For example in this PR [3], although the bugs say that
it might be a -Wimplicit-int bug it was rather just a wrong inclusion of
header where the data type off_t was not being found and it was assumed
to be the parameter.

As per my proposal, I’m going to stick to -Wimplicit-int for the rest few
days of the week and then slowly move to
-Wimplicit-function-declaration. I did come across some
-Wimplicit-function-declaration type of bugs which I’ve patched and
created a PR [6][7].

I’ve also come across two main language-specific blockers with
clang-16, namely Fortran and Vala. Lots of packages from sci-libs are
dependent on the package sci-libs/lapack which is failing to build on
with clang-16. As a result, I’ve to keep some of the sci-libs bugs on
halt for now. On the Vala front, not much we (as in Gentoo people/devs)
can do, this is a main blocker for some GNOME packages.

That’s it for this week, hopefully, I’ll be able to patch more packages
in the coming weeks.

[1]: https://github.com/gentoo/gentoo/pull/31357/files#diff-aaf358e6aacd565fcdd354d1ff87b08b1b2c679aaf978af900caa00c70a7978eR46
[2]: https://github.com/VirtualGL/virtualgl/commit/441c4e77d8e33edb28d3015b573e4e45bb13d684
[3]: https://github.com/gentoo/gentoo/pull/31520
[4]: https://github.com/gentoo/gentoo/pull/31464
[5]: https://github.com/gentoo/gentoo/pull/31411
[6]: https://github.com/gentoo/gentoo/pull/31476
[7]: https://github.com/gentoo/gentoo/pull/31513

This entry was posted in 2023 GSoC, Modern C Package Porting. Bookmark the permalink.

Leave a Reply

Your email address will not be published.