Menu

Parsing error: "try" in C

2019-11-26
2019-11-27
  • Morten MacFly

    Morten MacFly - 2019-11-26

    Dear all,

    given this code:

    int main(void)
    {
    int try = 0; int i=0; int j=0;
    for (i=0; i<10; i++)
    {
    ++try;
    for (j=0; j<10; j++)
    {
    try++;
    }
    }
    }
    ...in a C file results in a syntax error (in the line with ++try) even
    if explicitly stated to be handled as "C" file. One could argue if it is
    wise to use C++ keywords in C, but its a false positive. Happened to me
    while parsing a third party lib - so its at least not my code...

     
  • Daniel Marjamäki

    One could argue if it is wise to use C++ keywords in C, but its a false positive

    Yes it is a false positive for sure.

     
  • Daniel Marjamäki

    I fail to reproduce with git head but I can reproduce with 1.88 so I guess it has been fixed.

     
  • Morten MacFly

    Morten MacFly - 2019-11-27

    I forgot to mention that I experienced thisbehaviour in v 1.8.9. However, I'll wait for 1.9.0 - if it's still there I'll report back, otherwise it seems solved. Thank you!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.