GNOME Bugzilla – Bug 641851
Wrong line numbers in warnings involving C++ files
Last modified: 2018-07-30 10:08:30 UTC
Created attachment 180399 [details] Doxyfile used with the code above The line numbers reported in warning messages do not refer to the faulty line, but often to the first line of a comment block. For the following code, Doxygen reports warnings on lines 1, 16 and 10 (in that order). /// /// @file main.cpp /// @author heinz@ozwirk /// @date 27.01.2011 File created /// #include "stdafx.h" #include "DoxyTest.h" /// /// @parm This is not the main function. /// void foo() {} /** * @paran This is the main function. */ int _tmain() {} D:/Source/DoxyTest/main.cpp(1) : warning: Found unknown command `\ozwirk' D:/Source/DoxyTest/main.cpp(16) : warning: Found unknown command `\paran' D:/Source/DoxyTest/main.cpp(10) : warning: Found unknown command `\parm'
The same (or related) problem happens in Markdown files. The following .md file (between the ---): ------------------------------------------------------------------------------------------------- Demonstrates wrong line problem {#WrongLine} =============================== # Introduction {#WrongLine_Introduction} Some introduction More important stuff # The details {#WrongLine_TheDetails} As described in the \ref DemoWrongLine_Introduction, blah blah blah. And some more blah blah. ------------------------------------------------------------------------------------------------- will report: WrongLine.md(7): warning : unable to resolve reference to `DemoWrongLine_Introduction' for \ref command (7) being the reported line number. The problem is actually on line 13.
While this is not much of a problem for unresolved references (can be found with 'search' in text editor), it is quite painful to find the cause of e.g. the following warning in a rather long markdown file: warning : Unexpected subsubsection command found inside section!
I can confirm this on svn r833 and on the 1.8.2 release.
When this happens for me, the line number reported in the warning message is lower than the line where the problem occurs. I suspect some input lines are being discarded without updating a line number counter. Perhaps a clue. As a related (?) issue, I had a @ref command without the definition. Got the following: page-main.dox:2151: warning: unable to resolve reference to `bsidx_qs_valid' for \ref command The file page-main.dox had only 430 lines. It was not really C code, used no #include files, etc. I don't know where the line 2151 came from.
Created attachment 237284 [details] My Testcase with Output
On 1.8.3.1, this bug does not reproduce. I am closing this bug as "resolved - fixed". If my attachment fails to work for you, or the bug otherwise reproduces itself with the latest version of doxygen, attach a testcase in a tar or zip and reopen this bug.
The issue persists when using Markdown as outlined in my post above. The original issue seems to be fixed. I don't know if I should open a new bug or reopen this one.
Hi Philipp, please open a new bug report and attach a self-contained example (i.e. a zip containg both the source code and a configuration file) so that I can easily reproduce the problem. Please don't paste the example in the bug report text.
The new bug-report is here https://bugzilla.gnome.org/show_bug.cgi?id=694610
Created attachment 237395 [details] Testcase from Bug 694690
*** Bug 694690 has been marked as a duplicate of this bug. ***
Per bug 694690 and attachment in comment #10, I am reopening this bug.
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!