New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong syntax error during "constant expression evaluation" (Origin: bugzilla #657152) #4375

Open
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status NEW severity major in component general for ---
Reported in version 1.7.5.1 on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2011-08-23 10:48:33 +0000, Hans wrote:

Created attachment 194472
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).

On 2011-08-23 21:15:26 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next subversion update.

On 2011-12-03 18:23:00 +0000, Dimitri van Heesch wrote:

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.

On 2011-12-05 17:13:13 +0000, Hans wrote:

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.

On 2011-12-06 18:43:20 +0000, Dimitri van Heesch wrote:

Doxygen will dump the result after preprocessing if you use the -d Preprocessor option, i.e

  doxygen -d Preprocessor

On 2012-01-19 08:59:27 +0000, Akhil Laddha wrote:

Hans, ping, did you check pre-processing results as mentioned in comment# 4 ?

On 2012-01-27 14:33:43 +0000, Hans wrote:

Created attachment 206267
Screenshot of missing "Referenced by"

On 2012-01-27 14:34:15 +0000, Hans wrote:

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 }

On 2012-01-27 14:39:02 +0000, Hans wrote:

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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment