[Bug build/23568] New: gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] New: gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

            Bug ID: 23568
           Summary: gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not
                    declared in this scope (MinGW/MSYS)
           Product: gdb
           Version: 7.12.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: sizious at gmail dot com
  Target Milestone: ---

When compiling under the original MSYS/MinGW environment (downloaded from
www.mingw.org, i.e. NOT MinGW-w64/MSYS2, as I need Windows XP support), a
compilation error is thrown from the "gdb/ser-mingw.c" file:

../../gdb-7.12.1/gdb/ser-mingw.c: In function 'int
ser_windows_read_prim(serial*, size_t)':
../../gdb-7.12.1/gdb/ser-mingw.c:346:30: error: 'ERROR_IO_PENDING' was not
declared in this scope
       if (GetLastError () != ERROR_IO_PENDING
                              ^~~~~~~~~~~~~~~~
../../gdb-7.12.1/gdb/ser-mingw.c: In function 'int
ser_windows_write_prim(serial*, const void*, size_t)':
../../gdb-7.12.1/gdb/ser-mingw.c:368:30: error: 'ERROR_IO_PENDING' was not
declared in this scope
       if (GetLastError () != ERROR_IO_PENDING
                              ^~~~~~~~~~~~~~~~
make[3]: *** [ser-mingw.o] Error 1

Note: The host is "mingw32" and the target is "sh-elf".

PROPOSED CORRECTION:
I solved this bug by adding the following code snippet directly in the
"gdb/ser-mingw.c" file:

#ifndef ERROR_IO_PENDING
// In MinGW (original project, for MinGW-w64 I don't know), this code is
defined in that header file.
#include <winerror.h>
#endif

After that modification, the compilation of gdb-7.12.1 with host "mingw32" and
targetting "sh-elf" is successful.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #1 from SiZiOUS <sizious at gmail dot com> ---
Created attachment 11208
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11208&action=edit
Fix to allow MinGW/MSYS compilation of gdb-7.12.1

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #2 from SiZiOUS <sizious at gmail dot com> ---
Comment on attachment 11208
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11208
Fix to allow MinGW/MSYS compilation of gdb-7.12.1

--- ser-mingw.c 2017-01-21 13:46:47 +0000
+++ ser-mingw.c.patch   2018-08-24 08:30:27 +0000
@@ -31,6 +31,10 @@

 #include "command.h"

+#ifndef ERROR_IO_PENDING
+#include <winerror.h>
+#endif
+
 void _initialize_ser_windows (void);

 struct ser_windows_state

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #3 from SiZiOUS <sizious at gmail dot com> ---
Comment on attachment 11208
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11208
Fix to allow MinGW/MSYS compilation of gdb-7.12.1

--- ser-mingw.c 2017-01-21 13:46:47 +0000
+++ ser-mingw.c.patch   2018-08-24 08:30:27 +0000
@@ -31,6 +31,10 @@

 #include "command.h"

+#ifndef ERROR_IO_PENDING
+#include <winerror.h>
+#endif
+
 void _initialize_ser_windows (void);

 struct ser_windows_state

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
Thanks for the patch.  The gdb project doesn't review patches in
bugzilla; instead they must be sent to the gdb-patches list.
See the contribution checklist for details:
https://sourceware.org/gdb/wiki/ContributionChecklist

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #11208|1                           |0
           is patch|                            |

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #11208|0                           |1
        is obsolete|                            |

--- Comment #4 from SiZiOUS <sizious at gmail dot com> ---
Created attachment 11209
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11209&action=edit
Patch to allow MinGW/MSYS compilation of gdb-7.12.1

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |sh-elf
               Host|                            |mingw32

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #7 from SiZiOUS <sizious at gmail dot com> ---
I just submitted the patch now. I hope I respected all the guidelines of the
list.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #6 from SiZiOUS <sizious at gmail dot com> ---
Thanks for your feedback. I confirm that gdb-7.12.1 is compiling fine under
MSYS/MinGW with this little patch applied. I'll submit the patch to the list as
requested.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
What's the status of this?

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #9 from SiZiOUS <sizious at gmail dot com> ---
Sorry, long time no see.
The bug will not be fixed as 7.12.1 is an old release.
But the thing is, this bug is still here in 8.2.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/23568] gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #10 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to SiZiOUS from comment #3)

> Comment on attachment 11208 [details]
> Fix to allow MinGW/MSYS compilation of gdb-7.12.1
>
> --- ser-mingw.c 2017-01-21 13:46:47 +0000
> +++ ser-mingw.c.patch 2018-08-24 08:30:27 +0000
> @@ -31,6 +31,10 @@
>  
>  #include "command.h"
>  
> +#ifndef ERROR_IO_PENDING
> +#include <winerror.h>
> +#endif
> +
>  void _initialize_ser_windows (void);
>  
>  struct ser_windows_state

That shouldn't be necessary, winerror.h should be included by windows.h
(indirectly, via winbase.h).

--
You are receiving this mail because:
You are on the CC list for the bug.