aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-09-19 16:15:40 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2020-09-28 14:11:27 +0100
commitc5bdf60ac46401a51a7e974333d9622966e22d67 (patch)
tree4826e0c9dc0f8cbad201d6950d351fcf5838d7be
parent129c9844a6c40d5dee658151c2ff2c461a5a1365 (diff)
downloadnewlib-c5bdf60ac46401a51a7e974333d9622966e22d67.zip
newlib-c5bdf60ac46401a51a7e974333d9622966e22d67.tar.gz
newlib-c5bdf60ac46401a51a7e974333d9622966e22d67.tar.bz2
Cygwin: avoid GCC 10 error with -Werror=narrowing
../../../../src/winsup/cygwin/pinfo.cc: In member function 'DWORD pinfo::status_exit(DWORD)': ../../../../src/winsup/cygwin/ntdll.h:21:68: error: narrowing conversion of '-536870295' from 'NTSTATUS' {aka 'int'} to 'unsigned int' [-Wnarrowing] ../../../../src/winsup/cygwin/pinfo.cc:136:10: note: in expansion of macro 'STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION' ../../../../src/winsup/cygwin/sigproc.cc: In member function 'DWORD child_info::proc_retry(HANDLE)': ../../../../src/winsup/cygwin/ntdll.h:21:68: error: narrowing conversion of '-536870295' from 'NTSTATUS' {aka 'int'} to 'unsigned int' [-Wnarrowing] ../../../../src/winsup/cygwin/sigproc.cc:1120:10: note: in expansion of macro 'STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION' NT error statuses seem to be variously DWORD (unsigned) or NTSTATUS (signed)? So use the one which doesn't cause problems here.
-rw-r--r--winsup/cygwin/ntdll.h2
-rw-r--r--winsup/cygwin/pseudo-reloc.cc2
2 files changed, 1 insertions, 3 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 554e046..d4f6aaf 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -18,7 +18,7 @@ extern GUID __cygwin_socket_guid;
/* Custom Cygwin-only status codes. */
#define STATUS_THREAD_SIGNALED ((NTSTATUS)0xe0000001)
#define STATUS_THREAD_CANCELED ((NTSTATUS)0xe0000002)
-#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
+#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((DWORD) 0xe0000269)
/* Simplify checking for a transactional error code. */
#define NT_TRANSACTIONAL_ERROR(s) \
diff --git a/winsup/cygwin/pseudo-reloc.cc b/winsup/cygwin/pseudo-reloc.cc
index c250fdc..d015cc5 100644
--- a/winsup/cygwin/pseudo-reloc.cc
+++ b/winsup/cygwin/pseudo-reloc.cc
@@ -21,8 +21,6 @@
#else
# include "winsup.h"
# include <sys/cygwin.h>
-/* custom status code: */
-# define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
#endif
#include <stdio.h>