all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Fabrice Popineau <fabrice.popineau@supelec.fr>
Cc: emacs-devel@gnu.org
Subject: Re: Compiling (development) Emacs with MSVC
Date: Sat, 18 Dec 2010 13:05:58 +0200	[thread overview]
Message-ID: <83oc8jfii1.fsf@gnu.org> (raw)
In-Reply-To: <AANLkTikmhiNmd5gz8wkpqbgHni2LKkjhTtnPizaOEz7T@mail.gmail.com>

> From: Fabrice Popineau <fabrice.popineau@supelec.fr>
> Date: Mon, 13 Dec 2010 23:40:56 +0100
> Cc: emacs-devel@gnu.org
> 
> Patch attached.

Thanks.  I finally found time to review it, and I have a few comments
and questions:

> Apparently the ANSI C spec says that bit fields are unsigned, and enum are
> signed, hence the patch in lisp.h for various bit fields.
> Anyway, the MS compiler did extend sign and that was the main failure.

The problem and the solution you suggest are clear, but I'd like to
try to find a cleaner solution, if possible, one that doesn't require
so many #ifdef's.  Can you think of some change in one or two places
that would resolve this?  Can MSVC be forced in some way to use an
unsigned type for enumerations, for example?  If not, since the
problem is only with a single enumeration, would it work to use
something like this:

enum Lisp_Misc_Type
  {
    Lisp_Misc_Free = 0x5eab,
    Lisp_Misc_Marker = 0x5eac,
    Lisp_Misc_Intfwd = 0x5ead,

etc.?  Or maybe use 0x5eabU etc., with an explicitly unsigned value?

A few other issues with the rest of the patch:

> -#   define DECL_ALIGN(type, var) \
> +#   define DECL_ALIGN(type, var)                                \
>       type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var

Is this just some inadvertent reformatting, or is there some deeper
problem here?

>  TAGS-gmake:
> -	../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
> -	  --regex=@../nt/emacs-src.tags \
> -	  $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
> -	../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
> -	  $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
> -	../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
> -	  $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \
> -	  $(CURDIR)/*.h
> +# ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
> +#   --regex=@../nt/emacs-src.tags \
> +#   $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
> +# ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
> +#   $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
> +# ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
> +#   $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \
> +#   $(CURDIR)/*.h

Why did you comment out these commands?  They are not supposed to be
invoked under nmake, only under GNU Make.

> -	  memset (bloc->new_data + old_size, 0, size - old_size);
> +	  memset ((char *) bloc->new_data + old_size, 0, size - old_size);

Is this a real problem, or just a left-over from some attempt to debug
memory allocation problems, resolved by "-dynamicbase:no"?  If this is
a real problem, can you tell what it is?

> +#define fstat(a, b)   sys_fstat(a, b)
> +#define stat(a, b)   sys_stat(a, b)
> +#define utime   sys_utime

Why did you need to do this?  What happens if you don't?

> -      if (tmp && _access (tmp, D_OK) == 0)
> +      if (tmp && sys_access (tmp, D_OK) == 0)

What's wrong with calling _access from the MS runtime?

> -    " --cflags", USER_CFLAGS,
> +    " --cflags", stringer(USER_CFLAGS),

Why did you need to stringify here?  USER_CFLAGS is supposed to be
defined to a quoted string, like " -DFOO".  Can you tell why this
didn't work for you?

> +rem set SDK environment
> +if (%noopt%) == (Y) (
> +   call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /win7 /Debug
> +   set nodebug=N
> +)
> +
> +if (%nodebug%) == (Y) (
> +   call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /win7 /Release
> +   set noopt=N
> +)

Is there a less system-dependent way of doing this?  E.g., is there an
environment variable to replace the path to SetEnv.cmd?  Also, how to
set the /win7 switch portably, so that it works on non-Windows 7
platforms as well?  For that matter, is it at all necessary to call
SetEnv.cmd, in addition to using appropriate compiler/linker switches?

Thanks.



  reply	other threads:[~2010-12-18 11:05 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 21:21 Compiling (development) Emacs with MSVC Fabrice Popineau
2010-12-10 11:32 ` Eli Zaretskii
2010-12-13 22:40   ` Fabrice Popineau
2010-12-18 11:05     ` Eli Zaretskii [this message]
2010-12-18 11:15       ` Andreas Schwab
2011-01-03 10:21       ` Fabrice Popineau
2011-01-05 21:14         ` Stefan Monnier
2011-01-05 21:40           ` Tom Tromey
2010-12-18 11:18     ` Andreas Schwab
2011-01-03 10:26       ` Fabrice Popineau
2011-01-03 15:12         ` Stephen J. Turnbull
2011-11-05 11:19     ` bug#9960: Compiling Emacs trunk " Eli Zaretskii
2011-11-05 11:39       ` Eli Zaretskii
2011-11-05 12:54         ` Christoph Scholtes
2011-11-05 13:22           ` Eli Zaretskii
2011-11-05 13:58             ` Christoph Scholtes
2011-11-05 14:16               ` Eli Zaretskii
2011-11-05 14:53                 ` Eli Zaretskii
2011-11-05 15:51                   ` Óscar Fuentes
2011-11-05 16:10                     ` Eli Zaretskii
2011-11-05 16:27                 ` Christoph Scholtes
2011-11-05 16:50                   ` Eli Zaretskii
2011-11-05 16:57                     ` Eli Zaretskii
2011-11-05 17:22                     ` Christoph Scholtes
2011-11-05 18:20                       ` Christoph Scholtes
2011-11-05 19:33                         ` Eli Zaretskii
2011-11-05 20:38                           ` Christoph Scholtes
2011-11-05 21:11                             ` Eli Zaretskii
2011-11-05 22:07                               ` Christoph Scholtes
2011-11-05 22:15                                 ` Christoph Scholtes
2011-11-05 22:22                                   ` Christoph Scholtes
2011-11-06  4:03                                     ` Eli Zaretskii
2011-11-05 20:32                         ` Christoph Scholtes
2011-11-05 21:27                           ` Eli Zaretskii
2011-11-05 22:23                             ` Christoph Scholtes
2011-11-06  1:50                               ` Christoph Scholtes
2011-11-06  5:47                                 ` Eli Zaretskii
2011-11-06  5:37                               ` Eli Zaretskii
2011-11-07 16:13                             ` Fabrice Popineau
2011-11-07 16:57                               ` Eli Zaretskii
     [not found]                                 ` <CAFgFV9N4w+wi4J84BhoEZrgAuwJdFZtWzOAkdb_T9+B7L+Ftfg@mail.gmail.com>
2011-11-08 16:51                                   ` Eli Zaretskii
2011-11-07 17:03                               ` Eli Zaretskii
2011-11-10 19:56                                 ` Fabrice Popineau
2011-11-10 20:28                                   ` Lennart Borgman
2011-11-10 20:31                                     ` Juanma Barranquero
2011-11-10 20:29                                   ` Juanma Barranquero
2011-11-20 20:59                                     ` Fabrice Popineau
2011-11-20 21:15                                       ` Juanma Barranquero
2011-11-20 21:35                                         ` Dan Nicolaescu
2011-11-20 21:40                                           ` Juanma Barranquero
2011-11-21  2:30                                         ` Stefan Monnier
2011-11-21  2:45                                           ` Juanma Barranquero
2011-11-21  3:51                                             ` Eli Zaretskii
2011-11-21  8:21                                               ` Andreas Schwab
2011-11-21  9:54                                                 ` Eli Zaretskii
2011-11-21 12:14                                               ` Juanma Barranquero
2011-11-21 13:56                                                 ` Eli Zaretskii
2011-12-04  8:06                                                   ` Fabrice Popineau
2011-12-05  5:11                                                     ` Eli Zaretskii
2011-11-21 15:55                                       ` Richard Stallman
2011-11-11  9:39                                   ` Eli Zaretskii
2011-11-11 19:28                                     ` Fabrice Popineau
2011-11-11 19:53                                       ` Eli Zaretskii
2011-11-11 21:55                                         ` Fabrice Popineau
2011-11-12 13:50                                           ` Eli Zaretskii
2011-11-12 14:34                                             ` Fabrice Popineau
2011-11-12 15:59                                               ` Óscar Fuentes
2011-11-12 23:32                                                 ` Richard Stallman
2011-11-12 14:27                                       ` Eli Zaretskii
2011-11-12 17:55                                         ` Fabrice Popineau
2011-11-12 20:48                                           ` Eli Zaretskii
2011-11-12 22:27                                             ` Fabrice Popineau
2011-11-12 22:44                                               ` Fabrice Popineau
2011-11-12 23:08                                                 ` Fabrice Popineau
2011-11-13 14:45                                                   ` Christoph Scholtes
2011-11-27 19:05                                       ` Eli Zaretskii
2011-11-28  9:18                                         ` YAMAMOTO Mitsuharu
2011-11-28 11:51                                           ` Eli Zaretskii
2011-11-28 19:07                                         ` Fabrice Popineau
2012-03-24 13:46                                           ` Eli Zaretskii
2012-03-24 16:10                                             ` Fabrice Popineau
2012-03-24 18:42                                               ` Eli Zaretskii
2011-11-12 17:10                                   ` Christoph Scholtes
2011-11-12 20:37                                     ` Eli Zaretskii
2011-11-05 23:44         ` Fabrice Popineau
2011-11-06  3:42           ` Christoph Scholtes
2011-11-06  4:02           ` Eli Zaretskii
2011-11-08  6:43       ` bug#9960: fix for Bug#9772 should also help fix Bug#9960 Paul Eggert
2011-11-28  9:34       ` bug#9960: "emacsclient.c (main) <environ>: Remove declaration, " breaks build on Mac OS X David Caldwell
2011-11-28 17:29       ` bug#9960: : " Leon Zhang
2011-11-30 15:48       ` bug#9960: Compiling Emacs trunk with MSVC Tim Crews
2011-11-30 16:30         ` Tim Crews
2011-11-30 18:04         ` Eli Zaretskii
2011-11-30 18:22           ` Tim Crews
2011-11-30 19:17             ` Eli Zaretskii
2011-11-30 19:42               ` Tim Crews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83oc8jfii1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@supelec.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.