Oh puhleeeze Olivier, don't give me that anti-MS shit.
When GCC issues questionable warnings (this happens quite often, believe me), we go ahead
and put in
code to make the warnings go away. I'm sure you do this yourself, or if not, you
don't have any
problems with it.
So let's not be a Unix bigot, and allow the same stuff on the Windows side.
That cast in memcpy cannot possibly introduce a bug.
Olivier Galibert wrote:
On Mon, Mar 13, 2000 at 10:22:24PM -0700, Ben Wing wrote:
> OK, here's a fix. I also fixed alloc.c; nt.c is harder ... later.
> Index: src/alloc.c
> ===================================================================
> RCS file: /usr/CVSroot/XEmacs/xemacs/src/alloc.c,v
> retrieving revision 1.42.2.57
> diff -u -r1.42.2.57 alloc.c
> --- alloc.c 2000/03/13 07:27:50 1.42.2.57
> +++ alloc.c 2000/03/14 04:58:19
> @@ -5093,7 +5093,12 @@
> }
>
> /* Put back the lrecord_implementations_table */
> - memcpy (lrecord_implementations_table, p, sizeof
(lrecord_implementations_table));
> + /* We cast to void * because otherwise VC++ gives a warning.
> + This seems like a bug in VC++ in its handling of const,
> + but who knows? const is very tricky and fundamentally unworkable;
> + there is no const in Java because all attempts to create one that
> + was actually enforced were failures. */
> + memcpy ((void *) lrecord_implementations_table, p, sizeof
(lrecord_implementations_table));
> p += sizeof (lrecord_implementations_table);
>
> /* Reinitialize lrecord_markers from lrecord_implementations_table */
Veto. I don't want us to add casts to silence _buggy_ compiler
_warnings_ that may hide real problems in the future.
For instance, the day the lrecord_implementations_table becomes a
const table.
OG.
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/typing.html.