tech-pkg archive

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

QString and ctype(3)



The qgis build crashes on NetBSD current with:

  FAILED: src/crssync/CMakeFiles/synccrsdb /n0/tmp/work/geography/qgis/work/qgis-3.40.7/cmake-pkgsrc-build/src/crssync/CMakeFiles/synccrsdb 
  cd /n0/tmp/work/geography/qgis/work/qgis-3.40.7/cmake-pkgsrc-build/src/crssync && env LD_LIBRARY_PATH=/n0/tmp/work/geography/qgis/work/qgis-3.40.7/cmake-pkgsrc-build/output/bin/../lib DYLD_LIBRARY_PATH=/n0/tmp/work/geography/qgis/work/qgis-3.40.7/cmake-pkgsrc-build/output/bin/../lib /n0/tmp/work/geography/qgis/work/qgis-3.40.7/cmake-pkgsrc-build/output/bin/crssync
  ctype(3) tolower: invalid input: -62
  ninja: build stopped: subcommand failed.

and I think it's because of

  bool QgsCoordinateReferenceSystem::createFromString( const QString &definition )
  {
    if ( definition.isEmpty() )
      return false;

    QgsReadWriteLocker locker( *sCrsStringLock(), QgsReadWriteLocker::Read );
    if ( !sDisableStringCache )
    {
      QHash< QString, QgsCoordinateReferenceSystem >::const_iterator crsIt = sStringCache()->constFind( definition );
      if ( crsIt != sStringCache()->constEnd() )
      {
        // found a match in the cache                                                                                                                                                                                                                                                        
        *this = crsIt.value();
        return d->mIsValid;
      }
    }
    locker.unlock();

    bool result = false;
    const thread_local QRegularExpression reCrsId( QStringLiteral( "^(epsg|esri|osgeo|ignf|ogc|nkg|zangi|iau_2015|iau2000|postgis|internal|user)\\:(\\w+)$" ), QRegularExpression::CaseInsensitiveOption );
    QRegularExpressionMatch match = reCrsId.match( definition );
    if ( match.capturedStart() == 0 )
    {
      QString authName = match.captured( 1 ).toLower();
      if ( authName == QLatin1String( "epsg" ) )
      {
        result = createFromOgcWmsCrs( definition );
      }

Perhaps, because a QString is char, not unsigned char -- but that's
guessing.  But it may be some other toLower, not the one above.

cppreference.com (not sure I should believe that) says .toLower is a
horror show:

  https://en.cppreference.com/w/cpp/string/byte/tolower



Is anyone else seeing issues with QT programs under NetBSD current?


Home | Main Index | Thread Index | Old Index