Menu

win7 - cppchecker 1.58: why i get an error syntax?

2015-09-07
2018-04-27
  • Joaquim Miguel

    Joaquim Miguel - 2015-09-07

    i use cppchecker 1.58, on win7, i can't use above because of 1 DLL that cames with Visual Studio.
    when i select a folder, the file .h is found and the error check starts.
    but i get an error syntax on these line(3057(now it's a diferent line):

    HFONT hlf =(HFONT) GetCurrentObject(hdc,OBJ_FONT);

    (that line is for show that i don't have any error on code\compiler)
    i don't know work with options.. maybe you can help me just for test the memory leaks.
    can guide me to right place for fix my problem :(

     
  • Daniel Marjamäki

    I don't know why you get syntax error.

    when i select a folder, the file .h is found and the error check starts.

    can you try to prevent that .h file is found?

    i get an error syntax on these line

    HFONT hlf =(HFONT) GetCurrentObject(hdc,OBJ_FONT);
    

    There is no problems there.

    It seems that the real problem is somewhere else. Can you try to reduce the source code?

    That code is written in a function. What happens if you copy the code in this function and paste it in a new file.. and then run cppcheck on that file, do you still get the syntax error?

     
  • Clint Chelak

    Clint Chelak - 2018-04-27

    As I posted here, the error might be coming from another header file and carrying over into this one. Currently, it seems that once cppcheck includes all files, it isn't really sure when one file begins and one file ends, so if you're "missing a semicolon" from a previous file, then it might show that error in the next file in the list, on the next available line.

    You can test this by commenting out the line giving you an error and adding another simpler line to it, such as int nothing = 0;. If that line shows up as a syntax error, then your "error" is definitely either on the previous line or in another file.

    Good luck!

     

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.