Re: [Mingw-w64-public] [Patch] Fix warning

2016-09-27 Thread Kai Tietz
sure.

Thanks,
Kai

2016-09-25 21:37 GMT+02:00 David Wohlferd :
> Fixes this warning which occurs when wchar_t is used:
>
> .../mingw-w64-crt/misc/dirent.c:121:3: warning: 'memset' used with length
> equal to number of elements without multiplication by element size
> [-Wmemset-elt-size]
>memset (nd->dd_dir.d_name, 0, 260 /*FILENAME_MAX*/);
>
> Push?
>
> dw
>
>
> --
>
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

--
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [Patch] Fix warning

2016-09-25 Thread David Wohlferd

Fixes this warning which occurs when wchar_t is used:

.../mingw-w64-crt/misc/dirent.c:121:3: warning: 'memset' used with 
length equal to number of elements without multiplication by element 
size [-Wmemset-elt-size]

   memset (nd->dd_dir.d_name, 0, 260 /*FILENAME_MAX*/);

Push?

dw

diff --git a/mingw-w64-crt/misc/dirent.c b/mingw-w64-crt/misc/dirent.c
index f1ee0a2..4897cf4 100644
--- a/mingw-w64-crt/misc/dirent.c
+++ b/mingw-w64-crt/misc/dirent.c
@@ -118,7 +118,7 @@ _topendir (const _TCHAR *szPath)
   nd->dd_dir.d_ino = 0;
   nd->dd_dir.d_reclen = 0;
   nd->dd_dir.d_namlen = 0;
-  memset (nd->dd_dir.d_name, 0, 260 /*FILENAME_MAX*/);
+  memset (nd->dd_dir.d_name, 0, 260 * sizeof(nd->dd_dir.d_name[0])  /*FILENAME_MAX*/);
 
   return nd;
 }
--
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Patch] Fix warning error error for membarrier.c

2013-07-24 Thread dw

Done as 5980.

dw

On 7/23/2013 4:33 PM, dw wrote:



The patch looks good to me.


This patch requires re-building mingw-w64-crt/Makefile.in.  Can 
someone with the right autoconf do this checkin please?  The 
description should be something like:


Remove non-intrinsic function from intrinsic library.  Function is 
available in winnt.h.


Thanks,
dw


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [Patch] Fix warning error error for membarrier.c

2013-07-23 Thread dw

There is a compile warning coming from intrincs/membarrier.c:

/../../mingw-w64/mingw-w64-crt/intrincs/membarrier.c:4:6: warning: no 
previous prototype for 'MemoryBarrier' [-Wmissing-prototypes]/


There are two ways to fix it.

1) The easy, non-controversial way is to just add the prototype to the 
file.  And maybe to add the x64 version of code for slightly faster 
performance.


2) Of course I'm going to recommend the other fix which is to delete 
this file.  MemoryBarrier is NOT an intrinsic (ie it is not implemented 
as a builtin by the MSVC compiler).  According to MSDN 
http://msdn.microsoft.com/en-us/library/ms684208%28v=VS.85%29.aspx 
It's just an macro that's defined in winnt.h.  Which we already do.


The attached patch does the delete.  I can create the other patch 
instead if that seems like a better approach.


dw


Index: intrincs/membarrier.c
===
--- intrincs/membarrier.c	(revision 5979)
+++ intrincs/membarrier.c	(working copy)
@@ -1,10 +0,0 @@
-#include intrin.h
-
-/* for x86 only */
-void MemoryBarrier (void)
-{
-__LONG32 Barrier = 0;
-__asm__ __volatile__(xchgl %%eax,%0 
-  :=r (Barrier));
-}
-
Index: Makefile.am
===
--- Makefile.am	(revision 5979)
+++ Makefile.am	(working copy)
@@ -287,7 +287,7 @@
 
 # these only go into the 32 bit version:
 src_intrincs32=\
-  intrincs/membarrier.c   intrincs/readfsbyte.c   intrincs/readfsword.c   intrincs/readfsdword.c  \
+  intrincs/readfsbyte.c   intrincs/readfsword.c   intrincs/readfsdword.c  \
   intrincs/writefsbyte.c  intrincs/writefsword.c  intrincs/writefsdword.c
 
 if LIB32
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Patch] Fix warning error error for membarrier.c

2013-07-23 Thread Jacek Caban

On 7/23/13 11:20 PM, dw wrote:

There is a compile warning coming from intrincs/membarrier.c:

/../../mingw-w64/mingw-w64-crt/intrincs/membarrier.c:4:6: warning: no 
previous prototype for 'MemoryBarrier' [-Wmissing-prototypes]/


There are two ways to fix it.

1) The easy, non-controversial way is to just add the prototype to the 
file.  And maybe to add the x64 version of code for slightly faster 
performance.


2) Of course I'm going to recommend the other fix which is to delete 
this file.  MemoryBarrier is NOT an intrinsic (ie it is not 
implemented as a builtin by the MSVC compiler).  According to MSDN 
http://msdn.microsoft.com/en-us/library/ms684208%28v=VS.85%29.aspx 
It's just an macro that's defined in winnt.h.  Which we already do.


The attached patch does the delete.  I can create the other patch 
instead if that seems like a better approach.




The patch looks good to me.

Thanks,
Jacek
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Patch] Fix warning error error for membarrier.c

2013-07-23 Thread dw



The patch looks good to me.


This patch requires re-building mingw-w64-crt/Makefile.in.  Can someone 
with the right autoconf do this checkin please?  The description should 
be something like:


Remove non-intrinsic function from intrinsic library.  Function is 
available in winnt.h.


Thanks,
dw
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public