Skip to content

Conversation

@tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Mar 7, 2024

After @sisyphus work in #21925 on three warnings were left, this silences those.

tonycoz added 2 commits March 7, 2024 10:43
This appears to be the only place these warnings are produced even
though win32/win32.c contains several other function type casts.

None of the non-warning casts use the "void (*)(void)" type that is
documented to suppress the warning, and adding such a cast to
the lines warning seems less safe to me, cast from a stdcall
function pointer to a cdecl function pointer and back.

So, just suppress the warning where I saw it.
Since both the input and output parameters are restrict qualified,
this would be invalid, and it is possibe for PerlDir_mapW() to return
its parameter.  This warned on gcc:

win32.c: In function 'win32_link':
win32.c:3712:40: warning: passing argument 1 to 'restrict'-qualified parameter aliases with argument 2 [-Wrestrict]
 3712 |         ((aTHXa(PERL_GET_THX)), wcscpy(wOldName, PerlDir_mapW(wOldName)),
      |                                        ^~~~~~~~
@tonycoz tonycoz changed the title win32/win32.c: silence the rest of the warnings win32/win32.c: silence the rest of the gcc warnings Mar 7, 2024
@jkeenan jkeenan added the build-time-warnings Replaces [META] Build-time warnings RT #133556 label Mar 7, 2024
@tonycoz tonycoz merged commit a33729f into Perl:blead Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-time-warnings Replaces [META] Build-time warnings RT #133556

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants