Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mass rename C++ sources to .cc/.hh extension #3356

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Oct 3, 2024

As planned from the start of the C++ journey, rename all C++ files to a C++ extension to remove the confusion for both humans and tooling - so we now get to remove the associated cmake hacks to force it to use a C++ compiler.

We initially decided on going for .cxx/.hxx extension on the grounds that it's the technically most right thing to do as it matches with the build toolchain CXX/CXXFLAGS and all that. But at around 1/4 way through the rename I concluded that this is not only eye-bleeding ugly, it also totally obfuscates the difference between headers and sources in the visual noise it creates. Last but not least, it makes you think of All My Ex's Live in Texas, and that's about the last thing in I want to be thinking off. Both the song, and the exes.

Those of us working on rpm for a living need to think of their well-being, both mental and physical. The choice of .cc/.hh extension is primarily based on that: the .cxx/.hxx extension proved to be almost revolting in practise. To my total surprise really, I never expected this to matter at all. Maybe others have had similar feelings though, .cc/.hh is one of the more common choices, for example gcc and binutils use that.

Fixes: #3316

This one lone source got overlooked in the initial C++ enablement
in commit 37cdcc2. C++ doesn't like
jumping over variable declarations, so just move the declarations
early to minimally fix the build.

Nicely goes to show the danger of such hacks - you can always miss
something. On the library side things are likely to blow up in
linkage but you never know really.
As planned from the start of the C++ journey, rename all C++ files to
a C++ extension to remove the confusion for both humans and tooling -
so we now get to remove the associated cmake hacks to force it to
use a C++ compiler.

We initially decided on going for .cxx/.hxx extension on the grounds
that it's the technically most right thing to do as it matches with
the build toolchain CXX/CXXFLAGS and all that. But at around 1/4 way
through the rename I concluded that this is not only eye-bleeding ugly,
it also totally obfuscates the difference between headers and sources
in the visual noise it creates. Last but not least, it makes you think
of All My Ex's Live in Texas, and that's about the last thing in I
want to be thinking off. Both the song, and the exes.

Those of us working on rpm for a living need to think of their
well-being, both mental and physical. The choice of .cc/.hh extension
is primarily based on that: the .cxx/.hxx extension proved to be almost
revolting in practise. To my total surprise really, I never expected
this to matter at all. Maybe others have had similar feelings though,
.cc/.hh is one of the more common choices, for example gcc and binutils
use that.

Fixes: rpm-software-management#3316
@pmatilai pmatilai requested a review from a team as a code owner October 3, 2024 10:16
@pmatilai pmatilai requested review from ffesti and removed request for a team October 3, 2024 10:16
@pmatilai
Copy link
Member Author

pmatilai commented Oct 3, 2024

The first commit is to fixup the one oversight in the initial c++ work: rpmuncompress was being compiled as C because it wasn't listed as in cxx_sources. Just goes to prove how britle such hacks are - it's better to get this rename over and dealt with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mass-rename all relevant sources to a C++ extension
1 participant