diff mbox series

qga/commands-win32: Fix problem with redundant protype declaration

Message ID 20200915114757.55635-1-thuth@redhat.com
State New
Headers show
Series qga/commands-win32: Fix problem with redundant protype declaration | expand

Commit Message

Thomas Huth Sept. 15, 2020, 11:47 a.m. UTC
When compiling QEMU with MSYS2 on Windows, there is currently the
following error:

../qga/commands-win32.c:62:24: error: redundant redeclaration of
 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
   62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../qga/commands-win32.c:26:
C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:
 previous declaration of 'CM_Get_DevNode_PropertyW' was here
  840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
   const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer,
   PULONG PropertyBufferSize, ULONG ulFlags);

Seems like this protype is sometimes available in the cfgmgr32.h
header, and sometimes not. Let's silence the compiler warning here
to let the build pass with -Werror, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 I can take this through my "testing" tree together with some other
 MSYS2 patches if there are no objections.

 qga/commands-win32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Sept. 15, 2020, 12:50 p.m. UTC | #1
Cc'ing Marc-André

On 9/15/20 1:47 PM, Thomas Huth wrote:
> When compiling QEMU with MSYS2 on Windows, there is currently the

> following error:

> 

> ../qga/commands-win32.c:62:24: error: redundant redeclaration of

>  'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]

>    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>       |                        ^~~~~~~~~~~~~~~~~~~~~~~~

> In file included from ../qga/commands-win32.c:26:

> C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:

>  previous declaration of 'CM_Get_DevNode_PropertyW' was here

>   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,

>    const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer,

>    PULONG PropertyBufferSize, ULONG ulFlags);

> 

> Seems like this protype is sometimes available in the cfgmgr32.h

> header, and sometimes not.


This prototype is declared Since Windows Vista, but per
commit 4ac80866476 ("qga: drop < Vista compatibility")
it should be always true... So I'm confused.

Maybe we should build with:

  QEMU_BUILD_BUG_ON(_WIN32_WINNT < 0x0600); /* Vista */

Commit 56cdca1d7a6 ("build-sys: build with Vista API by default")
defines it if missing... Maybe that's where this problem comes
from? (On too old includes we force them as Vista).

> Let's silence the compiler warning here

> to let the build pass with -Werror, too.

> 

> Signed-off-by: Thomas Huth <thuth@redhat.com>

> ---

>  I can take this through my "testing" tree together with some other

>  MSYS2 patches if there are no objections.

> 

>  qga/commands-win32.c | 5 ++++-

>  1 file changed, 4 insertions(+), 1 deletion(-)

> 

> diff --git a/qga/commands-win32.c b/qga/commands-win32.c

> index 48d8bbe649..0c3c05484f 100644

> --- a/qga/commands-win32.c

> +++ b/qga/commands-win32.c

> @@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d,

>  DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,

>      0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);

>      /* DEVPROP_TYPE_STRING */

> -/* The following shoud be in cfgmgr32.h, but it isn't */

> +/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h */

>  #ifndef CM_Get_DevNode_Property

> +#pragma GCC diagnostic push

> +#pragma GCC diagnostic ignored "-Wredundant-decls"

>  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>      DEVINST          dnDevInst,

>      CONST DEVPROPKEY * PropertyKey,

> @@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>      ULONG            ulFlags

>  );

>  #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW

> +#pragma GCC diagnostic pop

>  #endif

>  

>  #ifndef SHTDN_REASON_FLAG_PLANNED

>
Marc-André Lureau Sept. 15, 2020, 1:55 p.m. UTC | #2
Hi

On Tue, Sep 15, 2020 at 4:57 PM Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> Cc'ing Marc-André

>

> On 9/15/20 1:47 PM, Thomas Huth wrote:

> > When compiling QEMU with MSYS2 on Windows, there is currently the

> > following error:

> >

> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of

> >  'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]

> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~

> > In file included from ../qga/commands-win32.c:26:

> > C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:

> note:

> >  previous declaration of 'CM_Get_DevNode_PropertyW' was here

> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST

> dnDevInst,

> >    const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE

> PropertyBuffer,

> >    PULONG PropertyBufferSize, ULONG ulFlags);

> >

> > Seems like this protype is sometimes available in the cfgmgr32.h

> > header, and sometimes not.

>

> This prototype is declared Since Windows Vista, but per

> commit 4ac80866476 ("qga: drop < Vista compatibility")

> it should be always true... So I'm confused.

>

> Maybe we should build with:

>

>   QEMU_BUILD_BUG_ON(_WIN32_WINNT < 0x0600); /* Vista */

>

> Commit 56cdca1d7a6 ("build-sys: build with Vista API by default")

> defines it if missing... Maybe that's where this problem comes

> from? (On too old includes we force them as Vista).

>

>

It doesn't have much to do with _WIN32_WINNT version, I think

The prototype was quite recently added in mingw-headers by Tomáš:
commit 5ace9333fa948dd4ce73bd262aaf0df39a0cf6ef
Author: Tomáš Golembiovský <tgolembi@redhat.com>
Date:   Fri Oct 18 11:22:22 2019 +0200

    include/cfgmgr32.h: add CM_Get_DevNode_PropertyW

It should be fine to silence the warning as proposed here.

> Let's silence the compiler warning here

> > to let the build pass with -Werror, too.

> >

> > Signed-off-by: Thomas Huth <thuth@redhat.com>

> > ---

> >  I can take this through my "testing" tree together with some other

> >  MSYS2 patches if there are no objections.

> >

> >  qga/commands-win32.c | 5 ++++-

> >  1 file changed, 4 insertions(+), 1 deletion(-)

> >

> > diff --git a/qga/commands-win32.c b/qga/commands-win32.c

> > index 48d8bbe649..0c3c05484f 100644

> > --- a/qga/commands-win32.c

> > +++ b/qga/commands-win32.c

> > @@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate,

> 0xa8b865dd, 0x2e3d,

> >  DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,

> >      0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);

> >      /* DEVPROP_TYPE_STRING */

> > -/* The following shoud be in cfgmgr32.h, but it isn't */

> > +/* The CM_Get_DevNode_PropertyW prototype is only sometimes in

> cfgmgr32.h */

> >  #ifndef CM_Get_DevNode_Property

> > +#pragma GCC diagnostic push

> > +#pragma GCC diagnostic ignored "-Wredundant-decls"

> >  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

> >      DEVINST          dnDevInst,

> >      CONST DEVPROPKEY * PropertyKey,

> > @@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

> >      ULONG            ulFlags

> >  );

> >  #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW

> > +#pragma GCC diagnostic pop

> >  #endif

> >

> >  #ifndef SHTDN_REASON_FLAG_PLANNED

> >

>

>

>

>


-- 
Marc-André Lureau
<div dir="ltr"><div dir="ltr">Hi<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 15, 2020 at 4:57 PM Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Cc&#39;ing Marc-André<br>
<br>
On 9/15/20 1:47 PM, Thomas Huth wrote:<br>
&gt; When compiling QEMU with MSYS2 on Windows, there is currently the<br>
&gt; following error:<br>
&gt; <br>
&gt; ../qga/commands-win32.c:62:24: error: redundant redeclaration of<br>
&gt;  &#39;CM_Get_DevNode_PropertyW&#39; [-Werror=redundant-decls]<br>
&gt;    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
&gt;       |                        ^~~~~~~~~~~~~~~~~~~~~~~~<br>
&gt; In file included from ../qga/commands-win32.c:26:<br>
&gt; C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:<br>
&gt;  previous declaration of &#39;CM_Get_DevNode_PropertyW&#39; was here<br>
&gt;   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,<br>
&gt;    const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer,<br>
&gt;    PULONG PropertyBufferSize, ULONG ulFlags);<br>
&gt; <br>
&gt; Seems like this protype is sometimes available in the cfgmgr32.h<br>
&gt; header, and sometimes not.<br>
<br>
This prototype is declared Since Windows Vista, but per<br>
commit 4ac80866476 (&quot;qga: drop &lt; Vista compatibility&quot;)<br>
it should be always true... So I&#39;m confused.<br>
<br>
Maybe we should build with:<br>
<br>
  QEMU_BUILD_BUG_ON(_WIN32_WINNT &lt; 0x0600); /* Vista */<br>
<br>
Commit 56cdca1d7a6 (&quot;build-sys: build with Vista API by default&quot;)<br>
defines it if missing... Maybe that&#39;s where this problem comes<br>
from? (On too old includes we force them as Vista).<br>
<br></blockquote><div><br></div><div><div>It doesn&#39;t have much to do with _WIN32_WINNT version, I think<br></div><div><br></div>The prototype was quite recently added in mingw-headers by Tomáš:</div><div>commit 5ace9333fa948dd4ce73bd262aaf0df39a0cf6ef<br>Author: Tomáš Golembiovský &lt;<a href="mailto:tgolembi@redhat.com">tgolembi@redhat.com</a>&gt;<br>Date:   Fri Oct 18 11:22:22 2019 +0200<br><br>    include/cfgmgr32.h: add CM_Get_DevNode_PropertyW</div><div><br></div><div>It should be fine to silence the warning as proposed here.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; Let&#39;s silence the compiler warning here<br>
&gt; to let the build pass with -Werror, too.<br>
&gt; <br>
&gt; Signed-off-by: Thomas Huth &lt;<a href="mailto:thuth@redhat.com" target="_blank">thuth@redhat.com</a>&gt;<br>
&gt; ---<br>
&gt;  I can take this through my &quot;testing&quot; tree together with some other<br>
&gt;  MSYS2 patches if there are no objections.<br>
&gt; <br>
&gt;  qga/commands-win32.c | 5 ++++-<br>
&gt;  1 file changed, 4 insertions(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/qga/commands-win32.c b/qga/commands-win32.c<br>
&gt; index 48d8bbe649..0c3c05484f 100644<br>
&gt; --- a/qga/commands-win32.c<br>
&gt; +++ b/qga/commands-win32.c<br>
&gt; @@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d,<br>
&gt;  DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,<br>
&gt;      0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);<br>
&gt;      /* DEVPROP_TYPE_STRING */<br>
&gt; -/* The following shoud be in cfgmgr32.h, but it isn&#39;t */<br>
&gt; +/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h */<br>
&gt;  #ifndef CM_Get_DevNode_Property<br>
&gt; +#pragma GCC diagnostic push<br>
&gt; +#pragma GCC diagnostic ignored &quot;-Wredundant-decls&quot;<br>
&gt;  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
&gt;      DEVINST          dnDevInst,<br>
&gt;      CONST DEVPROPKEY * PropertyKey,<br>
&gt; @@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
&gt;      ULONG            ulFlags<br>
&gt;  );<br>
&gt;  #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW<br>
&gt; +#pragma GCC diagnostic pop<br>
&gt;  #endif<br>
&gt;  <br>
&gt;  #ifndef SHTDN_REASON_FLAG_PLANNED<br>
&gt; <br>
<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>
Marc-André Lureau Sept. 15, 2020, 1:56 p.m. UTC | #3
Hi

On Tue, Sep 15, 2020 at 3:49 PM Thomas Huth <thuth@redhat.com> wrote:

> When compiling QEMU with MSYS2 on Windows, there is currently the

> following error:

>

> ../qga/commands-win32.c:62:24: error: redundant redeclaration of

>  'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]

>    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>       |                        ^~~~~~~~~~~~~~~~~~~~~~~~

> In file included from ../qga/commands-win32.c:26:

> C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:

>  previous declaration of 'CM_Get_DevNode_PropertyW' was here

>   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST

> dnDevInst,

>    const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE

> PropertyBuffer,

>    PULONG PropertyBufferSize, ULONG ulFlags);

>

> Seems like this protype is sometimes available in the cfgmgr32.h

> header, and sometimes not. Let's silence the compiler warning here

> to let the build pass with -Werror, too.

>

> Signed-off-by: Thomas Huth <thuth@redhat.com>

>


Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


---
>  I can take this through my "testing" tree together with some other

>  MSYS2 patches if there are no objections.

>

>  qga/commands-win32.c | 5 ++++-

>  1 file changed, 4 insertions(+), 1 deletion(-)

>

> diff --git a/qga/commands-win32.c b/qga/commands-win32.c

> index 48d8bbe649..0c3c05484f 100644

> --- a/qga/commands-win32.c

> +++ b/qga/commands-win32.c

> @@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate,

> 0xa8b865dd, 0x2e3d,

>  DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,

>      0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);

>      /* DEVPROP_TYPE_STRING */

> -/* The following shoud be in cfgmgr32.h, but it isn't */

> +/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h

> */

>  #ifndef CM_Get_DevNode_Property

> +#pragma GCC diagnostic push

> +#pragma GCC diagnostic ignored "-Wredundant-decls"

>  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>      DEVINST          dnDevInst,

>      CONST DEVPROPKEY * PropertyKey,

> @@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>      ULONG            ulFlags

>  );

>  #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW

> +#pragma GCC diagnostic pop

>  #endif

>

>  #ifndef SHTDN_REASON_FLAG_PLANNED

> --

> 2.18.2

>

>

>


-- 
Marc-André Lureau
<div dir="ltr"><div>Hi<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 15, 2020 at 3:49 PM Thomas Huth &lt;<a href="mailto:thuth@redhat.com">thuth@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When compiling QEMU with MSYS2 on Windows, there is currently the<br>
following error:<br>
<br>
../qga/commands-win32.c:62:24: error: redundant redeclaration of<br>
 &#39;CM_Get_DevNode_PropertyW&#39; [-Werror=redundant-decls]<br>
   62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~<br>
In file included from ../qga/commands-win32.c:26:<br>
C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:<br>
 previous declaration of &#39;CM_Get_DevNode_PropertyW&#39; was here<br>
  840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,<br>
   const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer,<br>
   PULONG PropertyBufferSize, ULONG ulFlags);<br>
<br>
Seems like this protype is sometimes available in the cfgmgr32.h<br>
header, and sometimes not. Let&#39;s silence the compiler warning here<br>
to let the build pass with -Werror, too.<br>
<br>
Signed-off-by: Thomas Huth &lt;<a href="mailto:thuth@redhat.com" target="_blank">thuth@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Marc-André Lureau &lt;<a href="mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com</a>&gt;  <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

---<br>
 I can take this through my &quot;testing&quot; tree together with some other<br>
 MSYS2 patches if there are no objections.<br>
<br>
 qga/commands-win32.c | 5 ++++-<br>
 1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/qga/commands-win32.c b/qga/commands-win32.c<br>
index 48d8bbe649..0c3c05484f 100644<br>
--- a/qga/commands-win32.c<br>
+++ b/qga/commands-win32.c<br>
@@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d,<br>
 DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,<br>
     0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);<br>
     /* DEVPROP_TYPE_STRING */<br>
-/* The following shoud be in cfgmgr32.h, but it isn&#39;t */<br>
+/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h */<br>
 #ifndef CM_Get_DevNode_Property<br>
+#pragma GCC diagnostic push<br>
+#pragma GCC diagnostic ignored &quot;-Wredundant-decls&quot;<br>
 CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
     DEVINST          dnDevInst,<br>
     CONST DEVPROPKEY * PropertyKey,<br>
@@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>
     ULONG            ulFlags<br>
 );<br>
 #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW<br>
+#pragma GCC diagnostic pop<br>
 #endif<br>
<br>
 #ifndef SHTDN_REASON_FLAG_PLANNED<br>
-- <br>
2.18.2<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>
diff mbox series

Patch

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 48d8bbe649..0c3c05484f 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -57,8 +57,10 @@  DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d,
 DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,
     0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);
     /* DEVPROP_TYPE_STRING */
-/* The following shoud be in cfgmgr32.h, but it isn't */
+/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h */
 #ifndef CM_Get_DevNode_Property
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wredundant-decls"
 CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
     DEVINST          dnDevInst,
     CONST DEVPROPKEY * PropertyKey,
@@ -68,6 +70,7 @@  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
     ULONG            ulFlags
 );
 #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
+#pragma GCC diagnostic pop
 #endif
 
 #ifndef SHTDN_REASON_FLAG_PLANNED