GNOME Bugzilla – Bug 596872
Fortran: Backslashes in literals are always treated as special chars
Last modified: 2018-07-30 10:53:43 UTC
In Fortran code one may write a literal 'foo\bar' and the \ will be considered a literal backslash (at least with command line option -fno-backslash, with -fbackslash it *is* considered a metacharacter). The doxygen parser crashes on this, by stating an error at line n+1 (where n is nr of lines in file). For example: ******************************************************************** Error in file D:/dam_ar/MultiGridClass.f90 line: 2675, state: 20 ******************************************************************** R6025 - pure virtual function call (the file has 2674 lines) A command-line option for the fortran-mode of doxygen could solve this.
Please attach a fully self-contained testcase, i.e. a fortran file with which doxygen shows above error plus the corresponding doxyfile. This ... program x print *, 'foo\bar \n' end program ... does not show any problems.
Created attachment 176987 [details] Minimal test file with literal backslashes that cause crash.
Created attachment 176988 [details] Doxyfile for use with backslash.f90 Nothing special about this Doxyfile, so just for completeness.
*** Bug 602952 has been marked as a duplicate of this bug. ***
*** Bug 630580 has been marked as a duplicate of this bug. ***
Created attachment 177013 [details] [review] Potential patch This patch solves the issue, but the rules it removes where probably introduced with a reason. Needs to be carefully checked for regressions.
I've hit this same bug independently, applied the patch onto 1.7.3 release, and it builds the documentation for my mixed set of C, C++ and Fortran packages without crashing, which is good. I haven't yet had time to check the docs for any other changes introduced by the patch.
Created attachment 181928 [details] Another test case that causes Doxygen to crash This is another test case which is different but triggers the same bug (I believe, it is certainly fixed by the same patch). This is an issue regardless of whether the Preprocessor is enabled or not, it crashes with both settings.
Any progress on this issue? Bug 623296 and Bug 596872 prevent us from using Doxygen with our Fortran Projects. I really would like to use Doxygen. I am willing to test bug fixes.
The issue in this bug report the use of the backslash. This has ben solved by my proposed patch on github (pull request 773, https://github.com/doxygen/doxygen/pull/773). The mentioned bug_623296 (by Soeren Huettemann, I taken the liberty to add him on the CC list of that issue) is a different problem and will be investigated with that bug report.
As discussed in https://github.com/doxygen/doxygen/pull/734 , Doxygen has moved its issue tracking to https://github.com/doxygen/doxygen/issues All Doxygen tickets in GNOME Bugzilla have been migrated to Github. You can subscribe and participate in the new ticket in Github. You can find the corresponding Github ticket by searching for its Bugzilla ID (number) in Github. Hence I am closing this GNOME Bugzilla ticket. Please use the corresponding ticket in Github instead. Thanks a lot!