[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] HTTCP.c warning [PATCH]
From: |
Thomas Dickey |
Subject: |
Re: [Lynx-dev] HTTCP.c warning [PATCH] |
Date: |
Wed, 26 Jul 2006 18:03:48 -0400 (EDT) |
On Wed, 26 Jul 2006, Doug Kaufman wrote:
When compiling for MingW with warnings turned on, I noticed that
there is one item it the code that sets off the gcc warning that
"dereferncing of type-punned pointer will break strict-aliasing
rules". In the past I had the -fno-strict-aliasing flag included in my
CFLAGS, but it would probably be better to fix the code. As you know,
I am not a programmer. Is this the proper fix, or should something
else be done? It does make the warning go away.
A better fix would be to use a variable of the proper type, e.g.,
Doug
--- lynx2.8.6dev.18/WWW/Library/Implementation/HTTCP.c.ori 2006-05-29
15:44:54.000000000 -0700
+++ lynx2.8.6dev.18/WWW/Library/Implementation/HTTCP.c 2006-07-26
14:16:50.000000000 -0700
@@ -1150,7 +1150,7 @@
WSASetLastError(WSAHOST_NOT_FOUND);
unsigned long dummyId;
hThread = CreateThread(NULL, 4096UL, _fork_func, host, 0UL,
- (unsigned long *) &dwThreadID);
+ (unsigned long *)(void *) &dwThreadID);
&dummyId);
dwThreadID = dummyId;
if (!hThread)
MessageBox(NULL, "CreateThread",
"CreateThread Failed", 0L);
--
Doug Kaufman
Internet: address@hidden
_______________________________________________
Lynx-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lynx-dev
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net