Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32: drop -Wno-incompatible-pointer-types when pedantic #1094

Closed
wants to merge 1 commit into from

Commits on Sep 21, 2021

  1. win32: drop -Wno-incompatible-pointer-types when pedantic

    27e0c3c (win32: allow building with pedantic mode enabled, 2021-09-03)
    adds -W as a workaround to the use of `void *` to hold a pointer to a
    function, punting the final solution.
    
    The type used in Windows is a generic function type, but assigning it
    from a different function interface will require a cast that was
    missing from the original implementation, so lets add that.
    
    Sadly; that is not enough, as gcc will helpfully raise a -Wcast-function-type
    warnig when casting between functions that might have incompatible
    return types (ex: GetUserNameExW returns bool which is only half the
    size of the return type from FAPROC), so create a new type that could be
    used as a completely generic function pointer, which then could be assigned
    to the correct function pointer through a cast.
    
    This has the advantage that the generic pointer functions then will be
    opaque and not useful as functions without being assigned to the right
    function pointer variable (just like `void *` was meant to be in POSIX).
    
    Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
    carenas committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    e5aa358 View commit details
    Browse the repository at this point in the history