Menu

#16 initializing array failed

Moritz_2_0_1
closed
None
2
2020-12-28
2020-12-23
No

Hi Eckard,

I realized, that the following code seems not to be parsed correctly by abc2xml

static const uint32_t  array[3] =
{
 [0] = 0,
 [1] = 1,
 [2] = 2
};

Best regards and merry Christams
Wasili

Discussion

  • Eckard Klotz

    Eckard Klotz - 2020-12-24
    • status: open --> accepted
     
  • Eckard Klotz

    Eckard Klotz - 2020-12-24

    Hello Wasili.

    To solve this issue I have to provide a new configuration file. This patch should should solve your issue " initializing array failed ".

    • Please check the attached file with your virus scanner before you use it to replace the one with the same name in the bin folder of your Moritz distribution.
    • Replace with the attached file "ANSI_C_Source_C_only_grm.a2x" the one with the same name in your Moritz distribution sub folder "[MoritzRoot]\LangPack\ansi_c\a2x\".
    • It may be useful to keep the old files for the case that the new ones are not satisfying you.

    Note this patch was created for the newest Moritz patch published on 2020-12-23 and was not tested with older versions.

    • But actually it should work with the Moritz Release 2.1.0 also.
    • However, the further fixing of bug is done based on the last patch only.
    • So if you face additional issues related to this topic please update your Moritz release by using the patch as described in the readme.

    The patch, I provide here, is extending the syntax-rule called while detecting an initializer.

    • The modified rule itself is named as postfix_expression and detects the array-cell you want to initialize.
    • Until now an identifier for every cell was expected.
    • Now just mentioning the cell-number only as done by you will be accepted also.

    Please check this patch and respond with a comment if your issue is solved or not.

    Have a merry Christmas and a happy new year.

    Stay healthy,
    Eckard.

     
  • Eckard Klotz

    Eckard Klotz - 2020-12-24
    • status: accepted --> pending
     
  • Wasilios Goutas

    Wasilios Goutas - 2020-12-28

    Thanks Eckard, I tested it and it works
    BR
    Wasili

     
  • Eckard Klotz

    Eckard Klotz - 2020-12-28
    • status: pending --> closed
     

Log in to post a comment.