« first day (1760 days earlier)      last day (1093 days later) » 

12:33 AM
@KimJongUn it's non-standard. VLA's are in C, not C++. It's just that GCC implements is nonetheless.
 
 
1 hour later…
1:45 AM
@sehe: Thank you for your useful info. :-)
 
 
6 hours later…
7:54 AM
Errno is set to 0x6c when running a program which manipulates socket Apis on Win10.
What does the error code really mean?
 
8:36 AM
@John maybe 108 = Cannot send after transport endpoint shutdown
 
@PeterT Thank you so much.I think it's the right answer. How did you find it? I googled(i.e keywords: errno 0x6c windows), but found nothing useful .
 
I googled bsd socket error codes, because I know that the windows socket api also uses those error codes
oh and I converted it do decimal, just because
 
@PeterT Could you please show me the related url? I still could not find the related information with the keyword "BSD socket error codes". I only find this(microfocus.com/documentation/enterprise-developer/ed232/ETS/…) ,but it does not contain 0x6c(108)
 
8:52 AM
"bsd socket error 108"
kind of confusing though, because that says it's ESHUTDOWN but other pages give a different code for ESHUTDOWN
 
@PeterT “other pages give a different code for ESHUTDOWN”?Which page?
 
this says 108 aakinshin.net/posts/… and this says 58 freebsd.org/cgi/…
I guess it doesn't really matter as long as it's applicable to your use-case
 
@PeterT Maybe, they are both right. As per this(aakinshin.net/posts/…), 108 for linux, 58 for mac, 10101 for windows(see the table on that url).
I found we saw the same url(aakinshin.net/posts/…)...
 
9:39 AM
@KimJongUn even more useful info: malloc or new ...[] was never needed: godbolt.org/z/aa88Mhr5T
Oh very relevant question was answered yesterday stackoverflow.com/questions/67409337/…
 
 
2 hours later…
11:26 AM
@sehe: Thank you very much sir!
 
 
8 hours later…
7:07 PM
Is it standards-conformant to do wchar_t s[] = L"" "";, i.e. concatenate a wide string literal with a narrow one? Seems to work but I'm not sure if it will work everywhere.
 
@purefanatic interesting question it works even with 'wchar_t s[] = "a" L"b" "c";', in clang,gcc and msvc
but no idea what the standard says about it
 
Mh, I might have found an answer: stackoverflow.com/a/2192903/1007605 So at least for C99 it's legal. I think C++ mostly borrowed C's preprocessor without changes so it's probably ok in C++, too.
I recall having used a WIDEN macro just like the one in the question not too long ago and now I wonder why, when it should have worked without one :/
 
"If one of the strings has an encoding prefix and the other doesn't, the one that doesn't will be considered to have the same encoding prefix as the other." en.cppreference.com/w/cpp/language/string_literal
const wchar_t text[] = u8"cdf" L"aa";
this errors out though. understandibly
 
Ah yes, good find. That seals it!
@PeterT Yeah, I would have thought so
Well, this makes life easier, but now I have to find my now-obsolete code with the WIDEN macro inside... ;)
 

« first day (1760 days earlier)      last day (1093 days later) »