lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Dealling with gcc -dumpversion inconsistency


From: Vadim Zeitlin
Subject: [lmi] Dealling with gcc -dumpversion inconsistency
Date: Wed, 7 Oct 2020 19:01:31 +0200

 Hello,

 This is a minor annoyance rather than a serious problem, but building
under Linux currently always results in a couple of warnings like this:

/opt/lmi/src/lmi/workhorse.make:164: Untested cpp version '8'
/opt/lmi/src/lmi/workhorse.make:182: Untested g++ version '8'

I know that you're aware about it, because you've partially addressed it in
58c0d7cc9 (Allow exact gcc version "9" for x86_64-pc-linux-gnu, 2020-09-26)
and more recent e73c066d8 (Allow gcc version "10" as well as "10.0",
2020-10-04), but I don't think this is sufficient, even disregarding the
typo in the latter commit, which used gnu_cpp_version in both tests, when
it should have been using gnu_cxx_version in the second one.

 The reason is that the problem is not specific to gcc-10, but also happens
with gcc-8 and 9. In fact, gcc under Linux has apparently switched to
reporting only the major version in -dumpversion since version 7. Here are
the results of running `gcc -dumpversion` for all versions of gcc I have at
hand:

        3.3.6
        4.2.4
        4.4.7
        4.5.4
        4.6
        4.7
        4.8
        4.9.2
        4.9.4
        5.5.0
        6.3.0
        6.5.0
        7
        8
        9
        10

 As you can see, there isn't much consistency here, especially compared
with MinGW output which is

        3.4.5
        4.4.0
        4.5.0
        4.7.0
        4.8.0
        4.8.1
        4.9.1
        4.9.2
        5.1.0
        5.1.0
        5.3.0
        6.2.0
        7.2.0
        8.1.0
        8.2.0
        10.1.0

(and this is a mix of MinGW, MinGW-w64 and TDM compilers!).

 I am not sure what's going on with Linux gcc, but it would be nice to
avoid the warnings for all versions without having to account for each of
them individually. I see a few ways to do it, listed below in my personal
order of preference (from best to worst):

1. Just remove the version checks: it's somewhat strange to have 28 lines
   doing them in the makefile, when more than half of them test for the
   compilers not supported any longer and I honestly don't see what do they
   bring.

2. Check just the major version: this would be both shorter and more useful
   IMO, as we could just test that the version is in [8, 10] interval.

3. Switch to using `gcc --version|head -n1|sed whatever-it-takes` to
   extract the full version. There is a lot of variety in the format
   here, but it does always have major.minor.micro version number at
   least once in it.

Of course, there is also always the choice

0. Not do anything about this and/or keep adding more versions explicitly.

but I'm listing it last, according to the sort order criterion used.

 Do you think we should do anything here to fix these warnings? And, if so,
what? As usual, I can provide a patch/PR making the change if you can
confirm that it would be desirable.

 Thanks in advance,
VZ

Attachment: pgpM1wnMw8IvG.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]