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 657152 - Wrong syntax error during "constant expression evaluation"
Wrong syntax error during "constant expression evaluation"
Status: RESOLVED OBSOLETE
Product: doxygen
Classification: Other
Component: general
1.7.5.1
Other Windows
: Normal major
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
[moved_to_github]
Depends on:
Blocks:
 
 
Reported: 2011-08-23 10:48 UTC by Hans
Modified: 2018-07-30 10:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test project (82.90 KB, application/x-7z-compressed)
2011-08-23 10:48 UTC, Hans
Details
Screenshot of missing "Referenced by" (13.05 KB, image/png)
2012-01-27 14:33 UTC, Hans
Details

Description Hans 2011-08-23 10:48:33 UTC
Created attachment 194472 [details]
Test project

In my project I get more than 700syntax error messages from correct and very easy preprocessor expression like

#if (ControllerType == MB90675)

where both symbols are defined in the same file before.

E.g. sysconst1.h:

#define XB90675 0 /*!< \brief
* Val. range / Coding:  always 0
*/

#define XontrollerType XB90675  /*!< \brief
* Val. range / Coding: MB90675 (FUJITSU F2MC-16L  MB90675 type)
*/

#if (XontrollerType == XB90675) /* no "syntax error" here - because "XB90675" is not in comment? */
  #define XClk        4000
#endif



#define MB90675 0 /*!< \brief
* Val. range / Coding:  always 0
*/

#define ControllerType MB90675  /*!< \brief
* Val. range / Coding: MB90675 (FUJITSU F2MC-16L  MB90675 type)
*/

#if (ControllerType == MB90675)  /* wrong "syntax error" here */
  #define MClk        4000
#endif


#if ControllerType == MB90675  /* .. but no "syntax error" here */
  #define YClk        4000
#endif

The first block is same as second block, expect that first char of names changed to "X" - and obviously because "XB90675" is not in a comment, there is not syntax error. And the last #if gives no syntax error even though the only difference to second #if is the missing ().

In sysconst2.h I simply swapped the two blocks (and removed the last #if), which leads to syntax error message from both #if, even though the block with the X-names has nothing to do with the other block.

sysconst3.h is same as sysconst1.h, expect that "XB90675" is in the comment (and last #if removed). This leads to wrong "syntax error" message for both #if.

I made a "project" with only these test files, the doxy file and the result with log files, so you can immediately reproduce the error (tested with doxygen 1.7.5.1 under WinXP and Win7-32).
Comment 1 Dimitri van Heesch 2011-08-23 21:15:26 UTC
Confirmed. Should be fixed in the next subversion update.
Comment 2 Dimitri van Heesch 2011-12-03 18:23:00 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.7.6. 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 3 Hans 2011-12-05 17:13:13 UTC
No "warning: preprocessing issue while doing constant expression evaluation" found in test project and in the real project (the one where I found the problem) with doxygen 1.7.6 any more. But lots of dependency and call graphs are completely missing if I change from 1.7.5.1 to 1.7.6 - and I don't see what could be wrong...

It would be very helpful for me to isolate a problematic case (and generate a test project) if doxygen could output some sort of preprocessing result - how can I get this?

Looks for me that the warning is fixed, but constant evaluation itself is still wrong (at least in cases where modules depend on calculated defines in other headers or something like that), so I reopen this issue.
Comment 4 Dimitri van Heesch 2011-12-06 18:43:20 UTC
Doxygen will dump the result after preprocessing if you use the -d Preprocessor option, i.e

  doxygen -d Preprocessor
Comment 5 Akhil Laddha 2012-01-19 08:59:27 UTC
Hans, ping, did you check pre-processing results as mentioned in comment#4 ?
Comment 6 Hans 2012-01-27 14:33:43 UTC
Created attachment 206267 [details]
Screenshot of missing "Referenced by"
Comment 7 Hans 2012-01-27 14:34:15 UTC
Pong :)

I did test with -d Preprocessor and can't find the reason for the missing "Referenced by" and caller graphs.

But I don't even see in preprocessor output which parts are really active and which are inactive, e.g. I see:
03985 #if (OSEK_VERSION == OSEK_1_0)
03986 TASKBODY(SYSA_Reset_Tsk)
03987 #endif
03988 #if ( (OSEK_VERSION == OSEK_2_0)|| (OSEK_VERSION == OSEK_2_1))
03989 TASK(SYSA_Reset_Tsk)
03990 #endif
but only second #if is true!?

And in source it's:
#define OSEK_1_0 1 /*!< \brief
...
*/

#define OSEK_2_0 2 /*!< \brief
...
*/

#define OSEK_2_1 3 /*!< \brief
...
*/

#define OSEK_VERSION OSEK_2_1 /*!< \brief
...
*/

but in preprocessor output all values are missing, although they are simple numerical constants:

00076 #define OSEK_1_0/*!< \brief
...
00081 */
00082 
00083 #define OSEK_2_0/*!< \brief
...
00088 */
00089 
00090 #define OSEK_2_1/*!< \brief
...
00095 */
00096 
00097 #define OSEK_VERSION/*!< \brief
...
00103 */



Regarding the missing references:
In the screen shot you see on the right the output of v1.7.5.1, on the left the output of v1.7.6.1.

In doxygens preprocessor output I see:

00341 /*********************************//*!
00342   FILE LOCAL FUNCTION PROTOTYPES
00343 ************************************/
00344 void ResetContainer (void);
....

In a global task:
04044    ResetContainer();

And ResetContainer() itself:
00751 static void ResetContainer
00752 (
00753     void
00754 )
00755 {
....
00803    TMS_vReset();
...
00839 }
Comment 8 Hans 2012-01-27 14:39:02 UTC
Correction: In the screen shot left(!) is from v1.7.5.1 with correct "Referenced by", right(!) is from new v1.7.6.1 with missing "Referenced by".
Comment 9 André Klapper 2018-07-30 10:10:37 UTC
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!