Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Big issue with Visual Studio 2019 (some versions)
Big issue with Visual Studio 2019 (some versions) [message #53011] Sat, 08 February 2020 02:19 Go to previous message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Hello,
There is a big issue with Visual Studio 2019 (some versions)
The example gives a warning and with reason
It may seem like a small issue but it'd not. This is used all over UPP and TheIde.
I can't compile a working non crashing version of TheIde (and my sofware) with it.
It's roulette whether it works or not. On my collegues computer it works, on mine it doesn't

See example below.

#include <Core/Core.h>

using namespace Upp;

// this construction is used a lot in upp
String SomeFunction()
{
	StringBuffer s;
	s.Cat("M\0nkey", 6); // some binary data
	return s;  // warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied

	// this contruction (returning a StringBuffer to a String return type) is used a LOT in UPP
	// it relies on the constructor of String(StringBuffer& )  to do the copying
	// However another path is from StringBuffer::Begin() -> String::String(const char*)
	// this however does not work for binary data (containing a 0)
	// Visual Studio 2019 picks the first or the second option depending on which *EXACT* version of it you're using, and gives this warning that it flipped a coin
	// IT IS NOT A BENIGN WARNING! It's roulette if the software works or not.
	// I cannot compile a stable executable of TheIde with VS2019 on my computer. It just keeps
	// crashing. My collegue can. 
}

CONSOLE_APP_MAIN
{
	String rv = SomeFunction();
	Cout() << rv.GetCount() << "\r\n"; // Should print 6, but prints 1
}

[Updated on: Sat, 08 February 2020 11:52]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Vector initialization
Next Topic: Configurations [Solved]
Goto Forum:
  


Current Time: Wed Apr 24 12:03:04 CEST 2024

Total time taken to generate the page: 0.01870 seconds