def METHOD_NAME(env, cc):
    """Return the version of the GNU compiler, or None if it is not a GNU compiler."""
    cc = env.subst(cc)
    if not cc:
        return None
    if "++" in os.path.basename(cc):
        return None
    # Make path absolute, to improve cache hit rate.
    cc = getExecutablePath(cc, env)
    if cc is None:
        return None
    if cc not in v_cache:
        v_cache[cc] = _myDetectVersion(cc)
        scons_details_logger.info("CC '%s' version check gives %r" % (cc, v_cache[cc]))
    return v_cache[cc]