* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
@ 2008-08-14 21:11 Francis Litterio
2008-08-15 9:33 ` Andreas Schwab
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Francis Litterio @ 2008-08-14 21:11 UTC (permalink / raw)
To: bug-gnu-emacs
I found these additional compiler errors when building CVS Emacs with
Visual Studio 6.0 on Windows XP:
dired.c(964) : error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64
and:
w32fns.c(250) : error C2143: syntax error : missing ')' before '__stdcall'
w32fns.c(250) : error C2143: syntax error : missing '{' before '__stdcall'
w32fns.c(250) : error C2059: syntax error : ')'
w32fns.c(250) : error C2165: 'left-side modifier' : cannot modify pointers to data
The latter appears to be caused by the absense of a definition for the
symbol "HMONITOR". The following patches fix both of the above errors.
--
Fran
--- dired.c~ 2008-08-14 17:09:53.759788900 -0400
+++ dired.c 2008-08-14 17:13:16.585787100 -0400
@@ -961,7 +961,7 @@
values[7] = make_number (s.st_size);
/* If the size is out of range for an integer, return a float. */
if (XINT (values[7]) != s.st_size)
- values[7] = make_float ((double)s.st_size);
+ values[7] = make_float ((signed __int64)s.st_size);
/* If the size is negative, and its type is long, convert it back to
positive. */
if (s.st_size < 0 && sizeof (s.st_size) == sizeof (long))
--- w32fns.c~ 2008-08-14 17:23:58.614906000 -0400
+++ w32fns.c 2008-08-14 17:10:41.266229700 -0400
@@ -67,6 +67,8 @@
#define FOF_NO_CONNECTED_ELEMENTS 0x2000
#endif
+#define HMONITOR HANDLE
+
void syms_of_w32fns ();
void globals_of_w32fns ();
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-14 21:11 bug#722: More Visual Studio 6.0 compiler errors on Windows XP Francis Litterio
@ 2008-08-15 9:33 ` Andreas Schwab
2008-08-15 12:33 ` Eli Zaretskii
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2008-08-15 9:33 UTC (permalink / raw)
To: Francis Litterio; +Cc: 722, bug-gnu-emacs
Francis Litterio <flitterio@gmail.com> writes:
> --- dired.c~ 2008-08-14 17:09:53.759788900 -0400
> +++ dired.c 2008-08-14 17:13:16.585787100 -0400
> @@ -961,7 +961,7 @@
> values[7] = make_number (s.st_size);
> /* If the size is out of range for an integer, return a float. */
> if (XINT (values[7]) != s.st_size)
> - values[7] = make_float ((double)s.st_size);
> + values[7] = make_float ((signed __int64)s.st_size);
Tell Microsoft to fix their compiler, you are changeing perfectly valid
C into unportable junk.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-14 21:11 bug#722: More Visual Studio 6.0 compiler errors on Windows XP Francis Litterio
2008-08-15 9:33 ` Andreas Schwab
@ 2008-08-15 12:33 ` Eli Zaretskii
[not found] ` <mailman.16775.1218793661.18990.bug-gnu-emacs@gnu.org>
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2008-08-15 12:33 UTC (permalink / raw)
To: Francis Litterio, 722; +Cc: bug-gnu-emacs
> Date: Thu, 14 Aug 2008 17:11:12 -0400
> From: Francis Litterio <flitterio@gmail.com>
> Cc:
>
> --- w32fns.c~ 2008-08-14 17:23:58.614906000 -0400
> +++ w32fns.c 2008-08-14 17:10:41.266229700 -0400
> @@ -67,6 +67,8 @@
> #define FOF_NO_CONNECTED_ELEMENTS 0x2000
> #endif
>
> +#define HMONITOR HANDLE
> +
Does it work to replace this #define with the following line?
DECLARE_HANDLE(HMONITOR);
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
[not found] ` <mailman.16775.1218793661.18990.bug-gnu-emacs@gnu.org>
@ 2008-08-15 13:35 ` Francis Litterio
2008-08-15 16:17 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Francis Litterio @ 2008-08-15 13:35 UTC (permalink / raw)
To: Andreas Schwab, 722
Andreas Schwab wrote:
> Francis Litterio writes:
>
>> --- dired.c~ 2008-08-14 17:09:53.759788900 -0400
>> +++ dired.c 2008-08-14 17:13:16.585787100 -0400
>> @@ -961,7 +961,7 @@
>> values[7] = make_number (s.st_size);
>> /* If the size is out of range for an integer, return a float. */
>> if (XINT (values[7]) != s.st_size)
>> - values[7] = make_float ((double)s.st_size);
>> + values[7] = make_float ((signed __int64)s.st_size);
>
> Tell Microsoft to fix their compiler, you are changeing perfectly valid
> C into unportable junk.
You are preaching to the choir. :) I just want a clean build on Windows.
Emacs has always compiled using VC++ 6.0 in the past, so some change
must have introduced this problem.
I forgot that dired.c is not Windows-only code, so this patch is more
correct:
--- dired.c~ 31 Jul 2008 05:33:51 -0000 1.153
+++ dired.c 15 Aug 2008 14:04:04 -0000
@@ -961,7 +961,11 @@
values[7] = make_number (s.st_size);
/* If the size is out of range for an integer, return a float. */
if (XINT (values[7]) != s.st_size)
+#if defined(WINDOWSNT)
+ values[7] = make_float ((signed __int64)s.st_size);
+#else
values[7] = make_float ((double)s.st_size);
+#endif
/* If the size is negative, and its type is long, convert it back to
positive. */
if (s.st_size < 0 && sizeof (s.st_size) == sizeof (long))
Also, a 64-bit integer (signed or unsigned) cannot safely be cast to
double without loss of data. An IEEE 754 64-bit floating value only has
52-bits of mantissa. So the non-Windows implementation is not 100%
correct either.
--
Fran
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
[not found] ` <mailman.16795.1218804458.18990.bug-gnu-emacs@gnu.org>
@ 2008-08-15 14:20 ` Francis Litterio
2008-08-15 17:09 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Francis Litterio @ 2008-08-15 14:20 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 722
Eli Zaretskii wrote:
>> From: Francis Litterio
>>
>> --- w32fns.c~ 2008-08-14 17:23:58.614906000 -0400
>> +++ w32fns.c 2008-08-14 17:10:41.266229700 -0400
>> @@ -67,6 +67,8 @@
>> #define FOF_NO_CONNECTED_ELEMENTS 0x2000
>> #endif
>>
>> +#define HMONITOR HANDLE
>> +
>
> Does it work to replace this #define with the following line?
>
> DECLARE_HANDLE(HMONITOR);
Yes, that compiles.
--
Fran
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-15 13:35 ` Francis Litterio
@ 2008-08-15 16:17 ` Eli Zaretskii
2008-08-15 16:39 ` Fran Litterio
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2008-08-15 16:17 UTC (permalink / raw)
To: Francis Litterio, 722; +Cc: schwab, 722, bug-submit-list, bug-gnu-emacs, don
> Date: Fri, 15 Aug 2008 09:35:11 -0400
> From: Francis Litterio <flitterio@gmail.com>
> Cc:
>
> >> - values[7] = make_float ((double)s.st_size);
> >> + values[7] = make_float ((signed __int64)s.st_size);
> >
> > Tell Microsoft to fix their compiler, you are changeing perfectly valid
> > C into unportable junk.
>
> You are preaching to the choir. :) I just want a clean build on Windows.
> Emacs has always compiled using VC++ 6.0 in the past, so some change
> must have introduced this problem.
The problems in w32.c are due to a recent change I did to impement two
new primitives, but the change in dired.c that made st_size be
unsigned 64-bit type is fairly old. When did you last build the CVS
code?
> Also, a 64-bit integer (signed or unsigned) cannot safely be cast to
> double without loss of data.
Yes, when file sizes will start hitting 64-bits, we will start losing
precision here. But I hope till then all compilers will have long
double data type, and then this code could be fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-15 16:17 ` Eli Zaretskii
@ 2008-08-15 16:39 ` Fran Litterio
2008-08-15 17:02 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Fran Litterio @ 2008-08-15 16:39 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: schwab, 722, bug-submit-list, bug-gnu-emacs, don
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
Eli wrote:
> From: Francis Litterio
> Emacs has always compiled using VC++ 6.0 in the past, so some change
> > must have introduced this problem.
>
> The problems in w32.c are due to a recent change I did to impement two
> new primitives, but the change in dired.c that made st_size be
> unsigned 64-bit type is fairly old. When did you last build the CVS
> code?
>
Some timestamp sleuthing leads me to believe it was Jan 19th, 2008.
> Also, a 64-bit integer (signed or unsigned) cannot safely be cast to
> > double without loss of data.
>
> Yes, when file sizes will start hitting 64-bits, we will start losing
> precision here. But I hope till then all compilers will have long
> double data type, and then this code could be fixed.
Good point!
--
Fran
[-- Attachment #2: Type: text/html, Size: 1355 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-15 16:39 ` Fran Litterio
@ 2008-08-15 17:02 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2008-08-15 17:02 UTC (permalink / raw)
To: Fran Litterio; +Cc: 722, bug-gnu-emacs
> Date: Fri, 15 Aug 2008 12:39:27 -0400
> From: "Fran Litterio" <flitterio@gmail.com>
> Cc: 722@emacsbugs.donarmstrong.com, schwab@suse.de,
> bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org,
> don@donarmstrong.com
>
> > Emacs has always compiled using VC++ 6.0 in the past, so some change
> > > must have introduced this problem.
> >
> > The problems in w32.c are due to a recent change I did to impement two
> > new primitives, but the change in dired.c that made st_size be
> > unsigned 64-bit type is fairly old. When did you last build the CVS
> > code?
> >
>
> Some timestamp sleuthing leads me to believe it was Jan 19th, 2008.
In that case, it is quite probable that you didn't see those changes
then.
> > Also, a 64-bit integer (signed or unsigned) cannot safely be cast to
> > > double without loss of data.
> >
> > Yes, when file sizes will start hitting 64-bits, we will start losing
> > precision here. But I hope till then all compilers will have long
> > double data type, and then this code could be fixed.
>
>
> Good point!
Maybe I should simply make st_size be a signed 64-bit type. Does
anyone see any problems with that?
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-15 14:20 ` Francis Litterio
@ 2008-08-15 17:09 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2008-08-15 17:09 UTC (permalink / raw)
To: Francis Litterio; +Cc: 722
> Cc: 722@emacsbugs.donarmstrong.com
> Date: Fri, 15 Aug 2008 10:20:54 -0400
> From: Francis Litterio <flitterio@gmail.com>
>
> Eli Zaretskii wrote:
>
> >> From: Francis Litterio
> >>
> >> --- w32fns.c~ 2008-08-14 17:23:58.614906000 -0400
> >> +++ w32fns.c 2008-08-14 17:10:41.266229700 -0400
> >> @@ -67,6 +67,8 @@
> >> #define FOF_NO_CONNECTED_ELEMENTS 0x2000
> >> #endif
> >>
> >> +#define HMONITOR HANDLE
> >> +
> >
> > Does it work to replace this #define with the following line?
> >
> > DECLARE_HANDLE(HMONITOR);
>
> Yes, that compiles.
Thanks, installed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#722: More Visual Studio 6.0 compiler errors on Windows XP
2008-08-14 21:11 bug#722: More Visual Studio 6.0 compiler errors on Windows XP Francis Litterio
` (3 preceding siblings ...)
[not found] ` <mailman.16795.1218804458.18990.bug-gnu-emacs@gnu.org>
@ 2008-08-15 19:35 ` Stefan Monnier
4 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2008-08-15 19:35 UTC (permalink / raw)
To: Francis Litterio; +Cc: 722, bug-gnu-emacs
> I found these additional compiler errors when building CVS Emacs with
> Visual Studio 6.0 on Windows XP:
Let's not spend any time trying to support this compiler.
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-08-15 19:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 21:11 bug#722: More Visual Studio 6.0 compiler errors on Windows XP Francis Litterio
2008-08-15 9:33 ` Andreas Schwab
2008-08-15 12:33 ` Eli Zaretskii
[not found] ` <mailman.16775.1218793661.18990.bug-gnu-emacs@gnu.org>
2008-08-15 13:35 ` Francis Litterio
2008-08-15 16:17 ` Eli Zaretskii
2008-08-15 16:39 ` Fran Litterio
2008-08-15 17:02 ` Eli Zaretskii
[not found] ` <mailman.16795.1218804458.18990.bug-gnu-emacs@gnu.org>
2008-08-15 14:20 ` Francis Litterio
2008-08-15 17:09 ` Eli Zaretskii
2008-08-15 19:35 ` Stefan Monnier
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.