This is the mail archive of the cygwin-patches mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Cygwin: Build cygwin-console-helper with correct compiler

On Jun 25 00:54, Mark Geisert wrote:
> ---
>  winsup/utils/ | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/winsup/utils/ b/winsup/utils/
> index b64f457e7..cebf39572 100644
> --- a/winsup/utils/
> +++ b/winsup/utils/
> @@ -64,7 +64,7 @@ MINGW_BINS := ${addsuffix .exe,cygcheck cygwin-console-helper ldh strace}
>  # List all objects to be compiled in MinGW mode.  Any object not on this
>  # list will will be compiled in Cygwin mode implicitly, so there is no
>  # need for a CYGWIN_OBJS.
> -MINGW_OBJS := bloda.o cygcheck.o dump_setup.o ldh.o path.o strace.o
> +MINGW_OBJS := bloda.o cygcheck.o cygwin-console-helper.o dump_setup.o ldh.o path.o strace.o
>  MINGW_LDFLAGS:=-static
>  CYGCHECK_OBJS:=cygcheck.o bloda.o path.o dump_setup.o
> -- 
> 2.21.0

Careful!  This leads to a warning when building on 64 bit: In function 'int main(int, char**)': warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   HANDLE h = (HANDLE) strtoul (argv[1], &end, 0);
                                                ^ warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   h = (HANDLE) strtoul (argv[2], &end, 0);

Note that strtoul returns an unsigned long.  Mingw compiles
for native Windows, which is LLP64 rather than LP64:

  mingw:sizeof(long) == 4
  cygwin:sizeof(long) == 8

This needs fixing as well (use strtoull).


Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]