Why do I get a syntaxError on line 53? That is the line with :
enumTASKBAR_POS
This is the source code:
//// Miscellaneous.h : Header file for Miscellaneous.cpp////// Only include this header file once#pragmaonce#include"_Export.h"// Check whether to export this class or not#ifdefMISCELLANEOUS#ifdefCLASSES_DLL#defineMISCELLANEOUS_EXP__declspec(dllexport)#else#defineMISCELLANEOUS_EXP__declspec(dllimport)#endif#else#defineMISCELLANEOUS_EXP#endif// forward declarationsclassCDataCube;classCDate;classCPicture;classCTime;// A MAC addressstructMAC_ADDRESS{uint8pu8MacAddress[6];};// The display monitor dimensionsstructDISPLAY_MONITOR_DIMENSIONS{uint8u8TotRects;RECTpRect[64];DISPLAY_MONITOR_DIMENSIONS(){// Clear the variablesu8TotRects=0;memset(pRect,NULL,sizeof(pRect));}};// The taskbar positionenumTASKBAR_POS{left,// The taskbar is on the left side of the screentop,// The taskbar is on the top side of the screenright,// The taskbar is on the right side of the screenbottom// The taskbar is on the bottom side of the screen};// Function prototypesMISCELLANEOUS_EXPvoidAppendTextToEditBox(HWNDhWndEditbox,constwchar_t*pwcNewText,int32i32Len=-1);MISCELLANEOUS_EXPboolCheckMemProblem(int8*pi8Mem,int32i32Bytes);MISCELLANEOUS_EXPvoidClipRect(RECT*pRc,constRECT*pRcClip);MISCELLANEOUS_EXPboolCopyDataToClipboard(constvoid*pvData,int32i32Len,uint32u32Format=CF_UNICODETEXT);MISCELLANEOUS_EXPuint32CreateContactSheet(CPicture*pPicContactSheet,int32i32SheetWidth,int32i32ThumbHeight,constwchar_t*pwcDirectory,boolbIncludeSubDirs,constwchar_t*pwcFileSpec=L"*.*");MISCELLANEOUS_EXPboolDirectoryExists(constwchar_t*pwcDirectory);MISCELLANEOUS_EXPHANDLEEnumeratePortsInit();MISCELLANEOUS_EXPboolEnumeratePortsNext(HANDLEhDeviceInfoSet,wchar_t*pwcPort,int32i32MaxChars);MISCELLANEOUS_EXPboolFileExists(constwchar_t*pwcFileName);MISCELLANEOUS_EXPboolGetDirName(wchar_t*pwcDirName,int32i32MaxChars,constwchar_t*pwcTitle=nullptr,HWNDhWndParent=NULL);MISCELLANEOUS_EXPboolGetDisplayMonitors(DISPLAY_MONITOR_DIMENSIONS*pDmd);MISCELLANEOUS_EXPboolGetFileName(wchar_t*pwcFileName,int32i32MaxChars,boolbOpen,constwchar_t*pwcInitialDir=nullptr,boolbAddExtension=true,constwchar_t*pwcExtensionFilter=L"All files (*.*)|*.*",wstring*pWstrDebugLog=nullptr);MISCELLANEOUS_EXPint32GetFilesFromDir(constwchar_t*pwcDir,wchar_tppwcFiles[][MAX_PATH],int32i32MaxFiles,constwchar_t*pwcFileSpec=L"*.*");MISCELLANEOUS_EXPint32GetFilesFromDir(constwchar_t*pwcDir,boolbIncludeSubDirs,CDataCube*pDcFiles,int16i16FilenameCol,constwchar_t*pwcFileSpec=L"*.*");MISCELLANEOUS_EXPint64GetFileSize(constwchar_t*pwcFile);MISCELLANEOUS_EXPhostent*GetHostEnt(constint8*pi8Address);MISCELLANEOUS_EXPint8*GetIpAddress(int8*pi8IpAddress,int32i32MaxChars);MISCELLANEOUS_EXPwchar_t*GetIpAddress(wchar_t*pwcIpAddress,int32i32MaxChars);MISCELLANEOUS_EXPint32GetMacAddress(MAC_ADDRESS*pMacAddresses,uint8u8MaxAddresses=1);MISCELLANEOUS_EXPuint32GetMaxPrintableChars(HDChDc,constwchar_t*pwcText,int32i32MaxWidthInPixels);MISCELLANEOUS_EXPboolGetProxyIE(int8*pi8ProxyIEAdress,int32i32MaxChars,uint16*pu16ProxyIEPort);MISCELLANEOUS_EXPuint32GetSubDirsFromDir(constwchar_t*pwcDir,wchar_tppwcSubDirs[][MAX_PATH],uint32u32MaxSubDirs,constwchar_t*pwcSubDirSpec=L"*.*");MISCELLANEOUS_EXPboolGetTemporaryFileName(int8*pi8TempFileName,int32i32MaxChars);MISCELLANEOUS_EXPboolGetTemporaryFileName(wchar_t*pwcTempFileName,int32i32MaxChars);MISCELLANEOUS_EXPboolGetWindowsProductId(int8*pi8ProductId,int32i32MaxChars);MISCELLANEOUS_EXPboolGetWindowsProductId(wchar_t*pwcProductId,int32i32MaxChars);MISCELLANEOUS_EXPint32Http_Get(constint8*pi8Url,uint16u16Port,uint8*pu8Data,int32i32MaxLen,int8*pi8Header=nullptr,int32i32MaxHeaderLen=0);MISCELLANEOUS_EXPint32Http_Get(constwchar_t*pwcUrl,uint16u16Port,uint8*pu8Data,int32i32MaxLen,int8*pi8Header=nullptr,int32i32MaxHeaderLen=0);MISCELLANEOUS_EXPint32Http_Get(constint8*pi8Url,uint16u16Port,constwchar_t*pwcDstFile,int8*pi8Header=nullptr,int32i32MaxHeaderLen=0);MISCELLANEOUS_EXPint32Http_Get(constwchar_t*pwcUrl,uint16u16Port,constwchar_t*pwcDstFile,int8*pi8Header=nullptr,int32i32MaxHeaderLen=0);MISCELLANEOUS_EXPRECT*InitRect(RECT*pRcDst,int32i32Left,int32i32Top,int32i32Width,int32i32Height);MISCELLANEOUS_EXPRECT*InitRect(RECT*pRcDst,constRECT*pRcSrc=nullptr);MISCELLANEOUS_EXPboolIsSepaCountry(constwchar_t*pwcCountry);MISCELLANEOUS_EXPboolIsValidIpAddress(constint8*pi8IpAddress);MISCELLANEOUS_EXPboolIsValidIpAddress(constwchar_t*pwcIpAddress);MISCELLANEOUS_EXPuint32KillProcess(constwchar_t*pwcProcessName,uint32u32MaxProcesses=UINT32_MAX);MISCELLANEOUS_EXPvoidMoveRect(RECT*pRc,int32i32OffsetX,int32i32OffsetY);MISCELLANEOUS_EXPboolPrintText(constwchar_t*pwcText,HWNDhWnd,boolbFixedFont,constwchar_t*pwcJobName=nullptr);MISCELLANEOUS_EXPboolSetProcessPrivilege(HANDLEhToken,constwchar_t*pwcPrivilege,boolbEnable);MISCELLANEOUS_EXPvoidShowChmHelp(HINSTANCEhInst,HWNDhWndParent,wchar_t*pwcHelpFile,uint16u16TopicId);MISCELLANEOUS_EXPvoidShowChmHelpPopup(HINSTANCEhInst,HWNDhWndParent,wchar_t*pwcHelpFile,uint16u16TopicId,constPOINT*pPtPos=nullptr);MISCELLANEOUS_EXPvoidShowChmHelpPopup(HINSTANCEhInst,HWNDhWndParent,constwchar_t*pwcText,constPOINT*pPtPos=nullptr);MISCELLANEOUS_EXPTASKBAR_POSTaskBar_Hide();MISCELLANEOUS_EXPvoidTaskBar_Show(TASKBAR_POSeTaskBarPos);MISCELLANEOUS_EXPuint32WMI_GetProperty(constwchar_t*pwcWmiClass,constwchar_t*pwcProperty,wchar_t**ppwcResult,uint32u32MaxChars,uint32u32MaxResults);#ifdef_WIN64// 64-bit onlyMISCELLANEOUS_EXPint32WIA_EnumerateDevices();#else// 32-bit onlyMISCELLANEOUS_EXPvoid*GetThreadInformationBlock();MISCELLANEOUS_EXPuint32KillProcess_Alt(constwchar_t*pwcProcessName,uint32u32MaxProcesses=UINT32_MAX);#endif//--------------------------------------------------------------------------------------------------// This function swaps 2 elements aroundtemplate<classT>voidSwap(T*ptA,T*ptB){TtTemp;// Swap the elements aroundtTemp=*ptA;*ptA=*ptB;*ptB=tTemp;}//--------------------------------------------------------------------------------------------------// This function swaps 2 structures aroundtemplate<classT>voidSwapStructs(T*ptA,T*ptB){TtTemp;// Swap the elements aroundmemmove(&tTemp,ptA,sizeof(T));memmove(ptA,ptB,sizeof(T));memmove(ptB,&tTemp,sizeof(T));}
Last edit: Sander Bouwhuis 2016-07-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why do I get a syntaxError on line 53? That is the line with :
This is the source code:
Last edit: Sander Bouwhuis 2016-07-06
I do not get a syntaxError, neither with git head nor with 1.74. Which cppcheck version are you using?
It says v1.74 in the about box. The executable is from 05-Jun-2016 18:33.
Can you reproduce using just your code example? (i.e. without _Export.h)?
Then the error disappears.
This is _export.h:
I can't reproduce the syntax error.
If you use -E cppcheck will print the preprocessor output. Can you try this:
Do you get syntax error for E.cpp also? does it make more sense in that?