Skip to content

Commit

Permalink
Check syntax in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Feb 9, 2024
1 parent b6ac52e commit 857729c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@ jobs:
..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!
- name: Check windows.cpp syntax
if: matrix.config == 'debug'
run: |
cd test\cfg
cl.exe windows.cpp -DUNICODE=1 -D_UNICODE=1 /Zs || exit /b !errorlevel!
14 changes: 2 additions & 12 deletions test/cfg/windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ errno_t nullPointer_mbscat_s(unsigned char *strDestination, size_t numberOfEleme
return _mbscat_s(strDestination, numberOfElements, strSource);
}

#if !UNICODE
// errno_t _strncpy_s_l(char *strDest, size_t numberOfElements, const char *strSource, size_t count, _locale_t locale);
errno_t uninitvar__strncpy_s_l(char *strDest, size_t numberOfElements, const char *strSource, size_t count, _locale_t locale)
{
Expand All @@ -1117,7 +1118,6 @@ errno_t uninitvar__strncpy_s_l(char *strDest, size_t numberOfElements, const cha
return _strncpy_s_l(strDest, numberOfElements, strSource, count, locale);
}

errno_t _strncpy_s_l(char *strDest, size_t numberOfElements, const char *strSource, size_t count, _locale_t locale);
errno_t nullPointer__strncpy_s_l(char *strDest, size_t numberOfElements, const char *strSource, size_t count, _locale_t locale)
{
// cppcheck-suppress nullPointer
Expand All @@ -1128,6 +1128,7 @@ errno_t nullPointer__strncpy_s_l(char *strDest, size_t numberOfElements, const c
// no warning shall be shown for
return _strncpy_s_l(strDest, numberOfElements, strSource, count, locale);
}
#endif

void GetShortPathName_validCode(const TCHAR* lpszPath)
{
Expand All @@ -1147,17 +1148,6 @@ void GetShortPathName_validCode(const TCHAR* lpszPath)
delete[] buffer;
}

class MyClass : public CObject {
DECLARE_DYNAMIC(MyClass)
DECLARE_DYNCREATE(MyClass)
DECLARE_SERIAL(MyClass)
public:
MyClass() {}
};
IMPLEMENT_DYNAMIC(MyClass, CObject)
IMPLEMENT_DYNCREATE(MyClass, CObject)
IMPLEMENT_SERIAL(MyClass,CObject, 42)

void invalidPrintfArgType_StructMember(double d) { // #9672
typedef struct { CString st; } my_struct_t;

Expand Down

0 comments on commit 857729c

Please sign in to comment.