After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670853 - Cannot cast 0 to QCString in htmldocvisitor.cpp
Cannot cast 0 to QCString in htmldocvisitor.cpp
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: build
1.8.1
Other Solaris
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2012-02-26 22:11 UTC by Dagobert Michelsen
Modified: 2012-12-28 20:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use explicit QCString instead of 0 (898 bytes, patch)
2012-02-26 22:11 UTC, Dagobert Michelsen
none Details | Review
QCString issues in 1.8.2 (1.18 KB, patch)
2012-08-11 14:46 UTC, Dagobert Michelsen
none Details | Review

Description Dagobert Michelsen 2012-02-26 22:11:18 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.
Comment 1 Dimitri van Heesch 2012-02-27 20:08:09 UTC
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?
Comment 2 Dagobert Michelsen 2012-02-28 13:00:53 UTC
Yes, that also compiles cleanly.
Comment 3 Dagobert Michelsen 2012-05-19 20:44:17 UTC
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)
Comment 4 Dimitri van Heesch 2012-05-20 09:31:47 UTC
Thanks. I'll fix this and try to avoid such constructs in the future.
Comment 5 Dimitri van Heesch 2012-06-10 09:41:44 UTC
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.
Comment 6 Dagobert Michelsen 2012-08-11 14:45:15 UTC
The error appeared again in src/filedef.cpp in 1.8.2
Comment 7 Dagobert Michelsen 2012-08-11 14:46:17 UTC
Created attachment 220925 [details] [review]
QCString issues in 1.8.2
Comment 8 Dimitri van Heesch 2012-08-19 08:39:09 UTC
Thanks, it appears to be difficult not to introduce new instances when non of the compilers I use complain :-(
Comment 9 Dimitri van Heesch 2012-12-26 16:09:16 UTC
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.
Comment 10 Dagobert Michelsen 2012-12-28 20:06:34 UTC
I just verified doxygen 1.8.3 is clean of such error.