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

Closed

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.

Activity

  1. CDanU commented on Jul 14, 2017

    @CDanU
    Collaborator

    For the second star use:

    # Add or remove space before pointer star '*'
    sp_before_ptr_star              = remove   # ignore/add/remove/force

    The other star is misrecognized as CT_ARITH.

  2. added a commit that references this issue on Dec 7, 2017
  3. gmaurel commented on Jan 24, 2018

    @gmaurel
    Collaborator

    Fixed 337b538, Dec 28 16:02:40 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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