Patch to fix VC8 compiler warnings

3 views
Skip to first unread message

Mike Williams

unread,
Jan 14, 2008, 4:40:46 AM1/14/08
to Vimdev Developers
Hi,

Catching up from the weekend patches I had two warnings for my builds.
The attached patch fixes them - done against 7.1.228

HTH - TTFN

Mike
--
First Law of Cooking: A hot pot looks exactly the same as cold pot.

warnings.diff

Bram Moolenaar

unread,
Jan 14, 2008, 4:04:33 PM1/14/08
to Mike Williams, Vimdev Developers

Mike Williams wrote:

> Catching up from the weekend patches I had two warnings for my builds.
> The attached patch fixes them - done against 7.1.228

Thanks.

I'm wondering if LONGLONG is always defined when WIN3264 is defined. We
don't use LONGLONG yet anywhere.

--
BRIDGEKEEPER: What is your favorite colour?
GAWAIN: Blue ... No yelloooooww!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

George V. Reilly

unread,
Jan 14, 2008, 4:43:20 PM1/14/08
to vim...@googlegroups.com, Mike Williams, Vimdev Developers
On 14/01/2008, Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> Mike Williams wrote:
>
> > Catching up from the weekend patches I had two warnings for my builds.
> > The attached patch fixes them - done against 7.1.228
>
> Thanks.
>
> I'm wondering if LONGLONG is always defined when WIN3264 is defined. We
> don't use LONGLONG yet anywhere.

LONGLONG should be defined in all recent versions of the compiler and
SDK. Always as a 64-bit signed quantity. Recent = last six years or
so.
--
/George V. Reilly
http://www.georgevreilly.com/blog

Mike Williams

unread,
Jan 15, 2008, 6:15:39 AM1/15/08
to George V. Reilly, vim...@googlegroups.com, Vimdev Developers
On 14/01/2008 21:43, George V. Reilly wrote:
> On 14/01/2008, Bram Moolenaar <Br...@moolenaar.net> wrote:
>>
>> Mike Williams wrote:
>>
>>> Catching up from the weekend patches I had two warnings for my builds.
>>> The attached patch fixes them - done against 7.1.228
>> Thanks.
>>
>> I'm wondering if LONGLONG is always defined when WIN3264 is defined. We
>> don't use LONGLONG yet anywhere.
>
> LONGLONG should be defined in all recent versions of the compiler and
> SDK. Always as a 64-bit signed quantity. Recent = last six years or
> so.

MS document the LARGE_INTEGER structure as being around since Win95, so
I'd hope LONGLONG has been good for that long (excuse the pun) to.

TTFN

Mike
--
Bragging: the pitter-patter of little feats.

George V. Reilly

unread,
Jan 15, 2008, 12:33:07 PM1/15/08
to mike.w...@globalgraphics.com, vim...@googlegroups.com, Vimdev Developers

LARGE_INTEGER is a struct containing two 32-bit quantities. LONGLONG
is an integral type requiring compiler support for 64-bit ints. I
believe it was introduced as part of the initial Win64 work, which
happened internally at MS around 1999 or 2000.

Anyway, I'm sure that it's supported in VS.NET (2002) and it's
probably supported in VS98 if you update the SDK. Possibly even
without.

I have a set of virtual machine images at home with all the Microsoft
compilers from VS98 onwards, precisely for building Vim.

I'm growing less and less sympathetic to those who want to build Vim
with old compilers, however. Between the Visual C++ 2003 Toolkit,
Visual Studio 2005 Express, and Visual Studio 2008 Express, there are
three free compilers from Microsoft. If you really want to build your
own copy of Vim, the least you should be prepared to do is download a
recent copy of the Microsoft, cygwin, or MinGW compilers.

George V. Reilly

unread,
Jan 16, 2008, 4:43:25 AM1/16/08
to vim...@googlegroups.com, Vimdev Developers
On 14/01/2008, Mike Williams <mike.w...@globalgraphics.com> wrote:
> Hi,
>
> Catching up from the weekend patches I had two warnings for my builds.
> The attached patch fixes them - done against 7.1.228

I've attached the latest Win64 patch, which builds cleanly for Win64
and Win32 on the VC 6, 7.1, 8, and 9 compilers, aka VS 98, 2003, 2005,
and 2008. Done against 7.1.230.

(And, yes, LONGLONG works fine on VC6/VS 98.)

You can ignore the Python stuff for now, but I think the rest should
be taken. The Python stuff uses the new 64-bit aware interfaces in
Python 2.5, but it should work with Python 2.3 and 2.4 too.

vim-win64.diff

George V. Reilly

unread,
Jan 16, 2008, 12:35:44 PM1/16/08
to vim...@googlegroups.com, Vimdev Developers

Oh, yeah. test11 is broken for me on Win32 and Win64. sed isn't getting run.

It worked the last time I ran the tests, back in November. All I did
last night was an 'svn update' and fix a handful of cast warnings, so
it's unlikely that I broke it.

Adri Verhoef

unread,
Jan 17, 2008, 4:33:24 PM1/17/08
to vim...@googlegroups.com
Compilation of Vim 7.1.230 on an Alpha processor with Gcc yielded:

gui_motif.c: In function 'find_replace_dialog_create':
gui_motif.c:3816: warning: cast to pointer from integer of different size

Installation went fine.
The warning may not be exclusively tied to Vim 7.1.230, I skipped a few
versions before this one.

Adri

Bram Moolenaar

unread,
Jan 18, 2008, 7:29:51 AM1/18/08
to Adri Verhoef, vim...@googlegroups.com

Adri Verhoef wrote:

That line would be:

XtAddCallback(frdp->find, XmNactivateCallback,
find_replace_callback,
(XtPointer) (do_replace ? FRD_R_FINDNEXT : FRD_FINDNEXT));

I don't see how this is different from similar calls, e.g.:

XtAddCallback(frdp->replace, XmNactivateCallback,
find_replace_callback, (XtPointer)FRD_REPLACE);

Perhaps you can try out what would silence the compiler?

--
INSPECTOR END OF FILM: Move along. There's nothing to see! Keep moving!
[Suddenly he notices the cameras.]
INSPECTOR END OF FILM: (to Camera) All right, put that away sonny.
[He walks over to it and puts his hand over the lens.]

Adri Verhoef

unread,
Jan 21, 2008, 12:39:28 PM1/21/08
to Bram Moolenaar, vim...@googlegroups.com
On Fri, Jan 18, 2008 at 13:29:51 +0100, Bram Moolenaar wrote:
>
> Adri Verhoef wrote:
>
> > Compilation of Vim 7.1.230 on an Alpha processor with Gcc yielded:
> >
> > gui_motif.c: In function 'find_replace_dialog_create':
> > gui_motif.c:3816: warning: cast to pointer from integer of different size
>
> That line would be:
>
> XtAddCallback(frdp->find, XmNactivateCallback,
> find_replace_callback,
> (XtPointer) (do_replace ? FRD_R_FINDNEXT : FRD_FINDNEXT));
>
> I don't see how this is different from similar calls, e.g.:
>
> XtAddCallback(frdp->replace, XmNactivateCallback,
> find_replace_callback, (XtPointer)FRD_REPLACE);
>
> Perhaps you can try out what would silence the compiler?

Here is the solution:

XtAddCallback(frdp->find, XmNactivateCallback,
find_replace_callback,
(do_replace ? (XtPointer)FRD_R_FINDNEXT : (XtPointer)FRD_FINDNEXT));

Cheers,
Adri

Bram Moolenaar

unread,
Jan 21, 2008, 3:05:28 PM1/21/08
to Adri Verhoef, vim...@googlegroups.com

Adri Verhoef wrote:

Weird. I'll include it, should not hurt any other system.

--
The most powerful force in the universe is gossip.

Reply all
Reply to author
Forward
0 new messages