Re: [Patch] Remove _GLIBCXX_HAVE_BROKEN_VSWPRINTF from (was Re: GCC 4.8.0 Status Report (2012-10-29), Stage 1 to end soon)

2012-10-31 Thread JonY
On 10/31/2012 20:01, Jonathan Wakely wrote:
> On 31 October 2012 11:23, JonY wrote:
>> On 10/31/2012 19:12, Jonathan Wakely wrote:
>>>
>>> It looks like the workaround is in mingw not in GCC, so is it a
>>> problem that it won't be possible to use GCC 4.8 with existing mingw
>>> versions, or are users required to use a brand new mingw to use a new
>>> GCC?  Should that be documented in
>>> http://gcc.gnu.org/gcc-4.8/changes.html ?
>>>
>>
>> They are required to use the latest mingw-w64, the problem was that the
>> vfswprintf that libstdc++ expects isn't the same as the one MS provides,
>> so I've wrote a redirector to use the vsnwprintf, more precisely, the
>> mingw C99 compliant __mingw_vsnwprintf.
>>
>> std::to_wstring and std::to_string work according to some simple tests.
> 
> Excellent, the testsuite should automatically start running the
> relevant tests and we should be able to close
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015
> 

Yes, the correct way would be to check if the prototype given matches
the ISO version. MS version has 1 less argument. The workaround is only
active when C++11 is used though to maintain compatibility to older code.

The actual guard in the mingw-w64:

#if defined(__cplusplus) && (__cplusplus >= 201103L) &&
!defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)
...Redirect to ISO C99 compliant adapter with 4 args...
#else
...Use MS Version with 3 args...
#endif

So the tests and checks would just need to use -std=c++11 or gnu++11.

>> I guess the current comment about require mingw-w64 trunk at least r5437
>> is OK for the changes page. It should probably note that this change is
>> mingw-w64 specific, with w64 as the vendor key.
> 
> i.e. *-w64-mingw* ?  Or is *-w64-mingw32 more accurate?  (I don't
> really know how the mingw target triplets work, sorry!)
> 

In practice, *-w64-mingw32 is used more commonly when specifying
triplet, though for flexibility, checking should use *-w64-mingw*.

> I'll put something in the changes page later.
> 
> Thanks for fixing this.
> 

Thanks to Paolo for pushing it in too.




signature.asc
Description: OpenPGP digital signature


Re: [Patch] Remove _GLIBCXX_HAVE_BROKEN_VSWPRINTF from (was Re: GCC 4.8.0 Status Report (2012-10-29), Stage 1 to end soon)

2012-10-31 Thread Jonathan Wakely
On 31 October 2012 11:23, JonY wrote:
> On 10/31/2012 19:12, Jonathan Wakely wrote:
>>
>> It looks like the workaround is in mingw not in GCC, so is it a
>> problem that it won't be possible to use GCC 4.8 with existing mingw
>> versions, or are users required to use a brand new mingw to use a new
>> GCC?  Should that be documented in
>> http://gcc.gnu.org/gcc-4.8/changes.html ?
>>
>
> They are required to use the latest mingw-w64, the problem was that the
> vfswprintf that libstdc++ expects isn't the same as the one MS provides,
> so I've wrote a redirector to use the vsnwprintf, more precisely, the
> mingw C99 compliant __mingw_vsnwprintf.
>
> std::to_wstring and std::to_string work according to some simple tests.

Excellent, the testsuite should automatically start running the
relevant tests and we should be able to close
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015

> I guess the current comment about require mingw-w64 trunk at least r5437
> is OK for the changes page. It should probably note that this change is
> mingw-w64 specific, with w64 as the vendor key.

i.e. *-w64-mingw* ?  Or is *-w64-mingw32 more accurate?  (I don't
really know how the mingw target triplets work, sorry!)

I'll put something in the changes page later.

Thanks for fixing this.


Re: [Patch] Remove _GLIBCXX_HAVE_BROKEN_VSWPRINTF from (was Re: GCC 4.8.0 Status Report (2012-10-29), Stage 1 to end soon)

2012-10-31 Thread Paolo Carlini

Applied.

Thanks,
Paolo.


Re: [Patch] Remove _GLIBCXX_HAVE_BROKEN_VSWPRINTF from (was Re: GCC 4.8.0 Status Report (2012-10-29), Stage 1 to end soon)

2012-10-31 Thread JonY
On 10/31/2012 19:23, JonY wrote:
> 
>> Why is the define commented out by the patch, not simply removed?
>> If it's not needed then it's not needed. We have subversion to track
>> change history, we don't need to leave dead code lying around with
>> comments explaining why it's dead.
> 
> OK, I will remove it.
> 

Sorry, forgot to attach the patch.

ChangeLog
2012-10-31  Jonathan Yong  

* config/os/mingw32-w64/os_defines.h: Remove 
_GLIBCXX_HAVE_BROKEN_VSWPRINTF
as no longer required.


Index: libstdc++-v3/config/os/mingw32-w64/os_defines.h
===
--- libstdc++-v3/config/os/mingw32-w64/os_defines.h (revision 192802)
+++ libstdc++-v3/config/os/mingw32-w64/os_defines.h (working copy)
@@ -63,9 +63,6 @@
 // See libstdc++/20806.
 #define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1
 
-// See  libstdc++/37522.
-#define _GLIBCXX_HAVE_BROKEN_VSWPRINTF 1
-
 // See libstdc++/43738
 // On native windows targets there is no ioctl function. And the existing
 // ioctlsocket function doesn't work for normal file-descriptors.


signature.asc
Description: OpenPGP digital signature


Re: [Patch] Remove _GLIBCXX_HAVE_BROKEN_VSWPRINTF from (was Re: GCC 4.8.0 Status Report (2012-10-29), Stage 1 to end soon)

2012-10-31 Thread JonY
On 10/31/2012 19:12, Jonathan Wakely wrote:
> On 31 October 2012 11:01, Jonathan Wakely wrote:
>> On 31 October 2012 10:25, JonY wrote:
>>> On 10/30/2012 01:56, Jakub Jelinek wrote:
 Status
 ==

 I'd like to close the stage 1 phase of GCC 4.8 development
 on Monday, November 5th.  If you have still patches for new features you'd
 like to see in GCC 4.8, please post them for review soon.  Patches
 posted before the freeze, but reviewed shortly after the freeze, may
 still go in, further changes should be just bugfixes and documentation
 fixes.

>>>
>>> Somebody with commit rights please push "[Patch] Remove
>>> _GLIBCXX_HAVE_BROKEN_VSWPRINTF from mingw32-w64/os_defines.h".
>>>
>>> Kai has already approved, but is off for the week.
>>
>> I could have done that, if it had been sent to the right lists. All
>> libstdc++ patches go to both gcc-patches and libstd...@gcc.gnu.org
>> please.
>>
>> Let's move this to the libstdc++ list, I have some questions about the patch.
> 
> It looks like the workaround is in mingw not in GCC, so is it a
> problem that it won't be possible to use GCC 4.8 with existing mingw
> versions, or are users required to use a brand new mingw to use a new
> GCC?  Should that be documented in
> http://gcc.gnu.org/gcc-4.8/changes.html ?
> 

They are required to use the latest mingw-w64, the problem was that the
vfswprintf that libstdc++ expects isn't the same as the one MS provides,
so I've wrote a redirector to use the vsnwprintf, more precisely, the
mingw C99 compliant __mingw_vsnwprintf.

std::to_wstring and std::to_string work according to some simple tests.

I guess the current comment about require mingw-w64 trunk at least r5437
is OK for the changes page. It should probably note that this change is
mingw-w64 specific, with w64 as the vendor key.

> Why is the define commented out by the patch, not simply removed?
> If it's not needed then it's not needed. We have subversion to track
> change history, we don't need to leave dead code lying around with
> comments explaining why it's dead.

OK, I will remove it.




signature.asc
Description: OpenPGP digital signature