On 04/12/2016 03:12 PM, Sebastian Holtermann wrote:
> Here it is. Please review/commit.

Thanks.

> -    subDir = absPath
> -                  + cmsys::SystemTools::GetFilenamePath(currentMoc) + '/';
> +    std::string fileNamePath = 
> cmsys::SystemTools::GetFilenamePath(currentMoc);
> +    if ( fileNamePath.find ( ".." ) == std::string::npos )
> +      {
> +        subDir = absPath + fileNamePath + '/';
> +      }
> +    else
> +      {
> +      // We can't handle parent directories
> +      std::cerr << "AUTOGEN: error: moc include \"" << currentMoc
> +                << "\" contains parent directory reference \"..\""
> +                << std::endl;
> +      ::exit(EXIT_FAILURE);
> +      }
[snip]
> +  // Check: Look for name collisions
> +    {
> +    typedef std::map<std::string, std::string>::const_iterator Iter;
> +    for ( Iter ita = includedMocs.begin(); ita != includedMocs.end(); ++ita )
> +      {
> +      Iter itb = ita;
> +      ++itb;
> +      for ( ; itb != includedMocs.end(); ++itb )
> +        {
> +        if ( ita->second == itb->second )
> +          {
> +          std::cerr << "AUTOGEN: error: moc name collision" << std::endl
> +                    << ita->first << " -> " << ita->second << std::endl
> +                    << itb->first << " -> " << itb->second << std::endl;
> +          ::exit(EXIT_FAILURE);
> +          }
> +        }
> +      }
> +    }
> +

These two hunks look like error checks added to the existing logic.
Please split these out into preceding commits with their own messages
explaining the new errors.  Please also include a

 Help/release/dev/automoc-diagnostics.rst

file with a release note explaining the new diagnostics.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to