GNOME Bugzilla – Bug 670853
Cannot cast 0 to QCString in htmldocvisitor.cpp
Last modified: 2012-12-28 20:06:34 UTC
Created attachment 208456 [details] [review] Use explicit QCString instead of 0 I am trying to compile doxygen 1.8.0 on Solaris 9 Sparc with Sun Studio 12. In htmldocvisitor.cpp there is a ternary operator where one term expands to 0 whereas the other expands to a QCString yielding an error that the types cannot be cast to oneanother. The attached patch replaces the 0 by an empty QCString which is probably not the best solution, but my knowledge in the API is limited.
Hi Dagobert, I plan to use startLink(ref->ref(),ref->file(),ref->relPath(),ref->isSubPage() ? QCString() : ref->anchor()); can you check for me if that also works?
Yes, that also compiles cleanly.
The same issue happens to appear in index.cpp in 1.8.1 which can also be fixed with the same idiom: diff --git a/src/index.cpp b/src/index.cpp index a5f4754..8f6a819 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -605,18 +605,18 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv if (doc || src) { ol.startIndexListItem(); - ol.startIndexItem(doc ? fd->getReference() : 0, - doc ? fd->getOutputFileBase() : 0); + ol.startIndexItem(doc ? fd->getReference() : QCString(), + doc ? fd->getOutputFileBase() : QCString()); ol.parseText(fd->displayName()); - ol.endIndexItem(doc ? fd->getReference() : 0, - doc ? fd->getOutputFileBase() : 0); + ol.endIndexItem(doc ? fd->getReference() : QCString(), + doc ? fd->getOutputFileBase() : QCString()); ol.endIndexListItem(); if (ftv) { ftv->addContentsItem(FALSE, fd->displayName(), - doc ? fd->getReference() : 0, - doc ? fd->getOutputFileBase() : 0,0, + doc ? fd->getReference() : QCString(), + doc ? fd->getOutputFileBase() : QCString(),0, FALSE,FALSE,fd); } } @@ -693,8 +693,8 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) if ((!fullPathNames || fd->getDirDef()==0) && (doc || src)) { ftv->addContentsItem(FALSE,fd->displayName(), - doc ? fd->getReference() : 0, - doc ? fd->getOutputFileBase() : 0, + doc ? fd->getReference() : QCString(), + doc ? fd->getOutputFileBase() : QCString(), 0, FALSE,FALSE,fd); if (addToIndex)
Thanks. I'll fix this and try to avoid such constructs in the future.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.1.1. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.
The error appeared again in src/filedef.cpp in 1.8.2
Created attachment 220925 [details] [review] QCString issues in 1.8.2
Thanks, it appears to be difficult not to introduce new instances when non of the compilers I use complain :-(
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.3. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.
I just verified doxygen 1.8.3 is clean of such error.