Uploaded image for project: 'CernVM'
  1. CernVM
  2. CVM-1894

Compilation failure for gcc >9

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: CernVM-FS 2.7.3
    • Component/s: CVMFS
    • Labels:
      None
    • Platforms:
      ANY
    • Development:

      Description

      Hello,

      the regex used to detect the gcc major version in cmake/Modules/cvmfs_compiler.cmake fails for versions with more than one digit (i.e. gcc 10).

      I think the problem is that in:

      STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CVMFS_GCC_MAJOR "${CVMFS_GCC_VERSION}")
      

      the initial .* is greedy and will consume all digits but the last one. Replacing with .*? should do the job:

      STRING(REGEX REPLACE ".*?([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CVMFS_GCC_MAJOR "${CVMFS_GCC_VERSION}")
      

      Cheers
      Wainer

        Attachments

          Activity

            People

            • Assignee:
              smosciat Simone Mosciatti
              Reporter:
              vandelli Wainer Vandelli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: