The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,887 other followers

Archive for the ‘C++’ Category

OMF, COFF and the 32-bit/64-bit Delphi or C++ compilers

Posted by jpluimers on 2020/01/29

Via [WayBack] As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format. Bcc64 uses LLVM chain and therefore produces ELF .o files… – Primož Gabrijelčič – Google+:

David Heffernan:
dcc32 does coff and omf, dcc64 only coff

and later he commented:

One of the difficulties with linking objects is the handling of exceptions. The 64 bit exception model is table based, in contrast to the stack based 32 bit model.

I don’t think that the exception tables are written correctly for code linked in objects. If exceptions are raised then this can lead to abnormal process termination. Process just disappears. Poof!

One common way that this happens is floating point exceptions that are by default unmasked by the Delphi RTL. I have found it necessary to mask them when calling into any linked object code to avoid exceptions being raised.

And compiling with cl can be a bit of a game. It’s stack checking options need to be disabled. And there are a few other key switches that help. And then there’s the forward declaration trick to help the one pass compiler cope with C objects that are expected to be linked in a separate step.

Anyway, it can be quite a challenge at times, but I’ve yet to find a plain self contained C library that has defeated me!

–jeroen

Posted in C++, C++ Builder, Delphi, Delphi x64, Development, Software Development, Visual Studio C++ | 2 Comments »

Flexible and Economical UTF-8 Decoder

Posted by jpluimers on 2019/12/25

For my link archive: [Archive.is] Flexible and Economical UTF-8 Decoder.

Be sure to read the whole article there as the explanation of the initial algorithm is important and final algorithm is towards the end.

The foundation is a state machine combined with a lookup table to find the initial state and proceed to subsequent states.

Related (and reminder to check what David did):

–jeroen

Read the rest of this entry »

Posted in C, C++, Delphi, Development, Software Development | 1 Comment »

Teach Yourself C++ in 21 days…

Posted by jpluimers on 2019/10/10

[WayBackAbtruse Goose: Teach Yourself C++ in 21 days…

Via: [WayBack] “How to learn programming in 21 Days” – CodeProject – Google+

Read the rest of this entry »

Posted in C, C++, Development, Fun, Software Development | Leave a Comment »

Design Patterns & Refactoring

Posted by jpluimers on 2019/07/16

Design Patterns and Refactoring articles and guides. Design Patterns video tutorials for newbies. Simple descriptions and full source code examples in Java, C++, C#, PHP and Delphi.

Source: [WayBackDesign Patterns & Refactoring.

And indeed a lot of examples in Delphi too; few sites have that: Delphi site:sourcemaking.com.

–jeroen

Via: [WayBack] I stumbled upon this yesterday, very informative, accessible and also with Delphi examples – among other languages. – Steffen Nyeland – Google+

Posted in .NET, C, C#, C++, Delphi, Design Patterns, Development, Java, Java Platform, PHP, Scripting, Software Development | Leave a Comment »

It was all Greek to me: Iota · golang/go

Posted by jpluimers on 2019/05/21

Context is king!

Being Dutch, my association with iota was the phrase “Ik snap er geen iota van” (English: “It’s all Greek to me”), basically indicating iota is extremely small, similar to [WayBack] Iota | Definition of Iota by Merriam-Webster:

1an infinitesimal amount jot  (did not show an iota of interest)
2the 9th letter of the Greek alphabet — see alphabet table

But the first time, I saw iota used in golang, I actually confused it with [WayBack] itoa – C++ Reference, because I am more than slightly wordblind.

So code like this was all Greek to me at first, not understanding the conversion from integer to ASCII**, and slightly later, not understanding iota to be extremely small either. Heck, its usage indicates it is small from infinitesimal:

const (
    _           = iota // ignore first value by assigning to blank identifier
    KB ByteSize = 1 << (10 * iota)
    MB
    GB
    TB
    PB
    EB
    ZB
    YB
)

So it took me a bit of thought to realise that it actually had to mean something completely different, so I found

It makes me wonder why they named it like this.

Slightly related:

–jeroen

Read the rest of this entry »

Posted in C++, Development, Go (golang), Software Development | Leave a Comment »

 
%d bloggers like this: