06.06.2020 21:19 Alf P. Steinbach kirjutas:
> On 06.06.2020 19:33, Paavo Helde wrote:
>> 06.06.2020 15:09 alelvb kirjutas:
>>>
>>> Now another question arises:
>>> some times the error that I get is something about a double free
>>> deletion.
>>>
>>> But my code uses just std library items and default destructor, default
>>> copy constructor and default move constructor and some people report the
>>> same issue.
>>> What do you think about?
>>
>> If your own code does not contain any malloc/new/free/delete, then it
>> is indeed surprising to get "double free" errors. I can think only of
>> improper multithreading synchronization or general memory corruption
>> (i.e. a buffer overwrite similar to the last bug).
>>
>> One thing is pretty certain, the bug is in your code, not in the
>> compiler or STL, with 99.99% probability.
>
> Re compilers it used to be so in the 1980's, when I learned programming.
>
> It's no longer the case that compilers are dependable.
>
> When I code I regularly encounter compiler bugs & extreme limitations.
Although I normally stick to much more traditional coding style than
seen in your examples, I have also encountered several compiler bugs -
hence the 99.99% estimation of the bug being in my code, not 100%.
>
> One MSVC ICE (Internal Compiler Error, a crash) today. Combined with all
> the ungood stuff in modern Windows, the Microsoft idea of sabotaging
> "technologies" that they (some MS managers) want to discontinue, I have
> for some years felt a strong aversion to coding.
I believe the key point is to avoid proprietary languages and frameworks
which can disappear on a whim. Hence - C++. If MSVC is discontinued, one
can switch over to another implementation.
>
> The last time I was /surprised/ by the sabotage thing was in the early
> 2000's. I'd made a nice analog clock as a Windows HTML application via
> HTML+TIME. Suddenly one day the latter"technology" had been
> discontinued, they'd pulled the rug from under my little app.
>
> I don't know if Windows HTML applications still work. It's an HTML file
> with extension .HTA, running in local security context. It seems that
> all the desktop gadget "technologies" have disappeared, and they're
> similar: HTML, Javascript, local security context or sandbox.
The MS WebBrowser control (usable in a C++ app) is still working and
apparently can be configured to support any of the broken IE versions
from the past (if we are talking about backward compatibility).
> But, back to C++. Did you know, that MSVC has a 16KB limit on string
> literals? For example. It's something from original Zortech C I think.
No, I did not know that (so obviously the limit has been large enough
for my needs). And it seems to be 64K, not 16K, in my quick test:
1>fatal error C1091: compiler limit: string exceeds 65535 bytes in length