Skip to content

FUNC_CALL is detected on WINAPI (__stdcall) calls if the type is after WINAPI. If it's after the function is properly marked as FUNC_DEF. #1255

@mihaipopescu

Description

@mihaipopescu
static LONG WINAPI CustomUnhandledExceptionFilter(EXCEPTION_POINTERS * pExInfo)
{
    if (EXCEPTION_BREAKPOINT == pExInfo->ExceptionRecord->ExceptionCode) // Breakpoint. Don't treat this as a normal crash.
        return EXCEPTION_CONTINUE_SEARCH;
}

also need to check this as well

		typedef DWORD (WINAPI *SetDllDirectory) (LPCSTR);

For now, we've just hacked around it by set COMMENT WINAPI just like for all other __xxxcall.

We want to have a proper solution though or at least raise the issue on github side.

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60006-UNI-2049.cpp" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60006-UNI-2049.cpp"
index 4609fbe..600837d 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60006-UNI-2049.cpp"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60006-UNI-2049.cpp"
@@ -1,8 +1,8 @@
 // Pointer mark should be formatted (WINAPI* SetXX)
-typedef DWORD (WINAPI* SetDllDirectory)(LPCSTR);
+typedef DWORD (WINAPI * SetDllDirectory)(LPCSTR);
 // Pointer mark should be formatted (EXCEPTION_POINTERS* pExt)
-static LONG WINAPI CustomUnhandledExceptionFilter(EXCEPTION_POINTERS* pExInfo)
+static LONG WINAPI CustomUnhandledExceptionFilter(EXCEPTION_POINTERS * pExInfo)
 {
     if (EXCEPTION_BREAKPOINT == pExInfo->ExceptionRecord->ExceptionCode) // Breakpoint. Don't treat this as a normal crash.
         return EXCEPTION_CONTINUE_SEARCH;
 }

Debug support files:

60006-UNI-2049.cpp
60006-UNI-2049.cpp.log
60006-UNI-2049.cpp.unc
Uncrustify.Common-CStyle.cfg
UNI-2049.cpp

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions