Skip to content

Incorrect comparison of version number on Darwin #440

@ldionne

Description

@ldionne

Hi,

In src/tools/darwin.jam, there's the following code:

# - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
if $(real-version) < "4.0.0"
{
    flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
}

This adds a command-line flag only when the version of the compiler is less than "4.0.0". Now, I don't know much about BJam, however this seems to be doing a simple lexicographical comparison, not a version-like comparison of the strings. As a result, the version string "10.0.0" (for example) ends up comparing less than "4.0.0", and we (incorrectly) add the flag.

I believe that comparison (and the subsequent comparisons too) should be using a version-like comparison function, but I don't know whether that exists in BJam.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions