Source Indexing SVN Repositories is Broken

Some of us spend a fair amount of time pouring through crash dumps generated on Windows. For us, the symbol server support provided by Microsoft’s debugging engines is a godsend. However, source indexing is an even bigger boon because it allows us to not only see the symbols within the crash, but be able to pull the exact source down for source-level debugging.

Unfortunately, it seems that SVN 1.7 broke this functionality! Since it is so critical to my daily workflow, I set about fixing it.
Continue reading

Posted in Win32 | Tagged , , | 1 Comment

Value Types in C++11

You may have heard these terms used for various programming languages before, but I wanted to discuss them in a bit more detail since they’re a fairly fundamental concept in compilers that spill over into the way you use the languages themselves.
Continue reading

Posted in C/C++ | Tagged , , , | 6 Comments

Now, With More Tidbits!

Sorry about the distinct lack of content lately, but I’ve been busy putting together a new training initiative for my day job. This initiative involves sending weekly snippets of information on C and C++ to many of our developers. The content is too small to justify a full blog post in many cases, but is interesting enough to warrant discussion. As a content management system, I have decided to collate these tidbits here on Ruminations. You can find all of them here: Be sure to check back every Friday, as that’s when I’ll be posting new tidbits. If you have suggestions for tidbits you’d like to see, or want clarification on existing tidbits, feel free to leave comments on the Tidbits post.

Posted in C/C++ | Leave a comment

Theory and Reality

One thing which I am pretty religious about is the placement of ++ and — in an expression. You have two options for where it can go. If it goes before the operand, it’s a pre-increment/decrement. If it goes after the operand, it’s a post-increment/decrement. They have different semantics, and so there are correctness issues with their placement. But what I want to talk about are the cases where there are not correctness issues, and what should happen.
Continue reading

Posted in C/C++ | Tagged , | Leave a comment

Memory Management in Frameworks

As a framework designer, you have a lot of things to worry about. Calling conventions, size compatibility, structure layout, etc. I’d like to briefly talk about another thing to worry about: memory management. I’m not just talking about “please don’t leak memory.” I’m talking about keeping a proper division of labor, and why it’s crucial for frameworks.
Continue reading

Posted in Framework Design | Tagged | 1 Comment

Describing the MSVC ABI for Structure Return Types

An ABI is an “application binary interface”, which is basically a contract between pieces of executable code on how to behave. The ABI dictates things like how parameters are passed, where return values go, how to create and destroy stack frames, etc. As a programmer, you oftentimes don’t have to worry about this sort of thing because the compiler takes care of it for you. However, if you want code from one compiler to talk to code from another compiler, the ABI is extremely important because if the two compilers don’t agree, the two pieces of code won’t be able to work together.

I don’t want to go into the entire MSVC ABI (that could likely fill a book!), but instead would like to focus on the under-documented portion having to do with the way structures are returned from functions. There is some documentation on the subject on MSDN, the latest of which can be found here.
Continue reading

Posted in C/C++, Win32 | Tagged , , , , | 6 Comments

The Anatomy of a Code Review

Programmers have many tools available to them for improving the quality of their code. One of my personal favorites is the code review — getting another set of eyes on my source code always challenges my assumptions, and invariably flushes out assumptions I’ve missed or mistakes I’ve made. I’d like to cover what I believe are the key elements to a successful code review. However, I would like to stress that what works for me may or may not work for you.
Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Varargs? More like Arghargs!

This was a silly mistake on my part, but one which took me several hours to track down. In retrospect, I had everything at my disposal to tell me exactly what the problem was, I just didn’t notice it. It had to do with a varargs method pair for performing some logging operations. I had one logging method, and one helper logging method, both accessible to the caller. It turns out this was a bad idea.
Continue reading

Posted in C/C++ | Leave a comment

Worst Compiler Abuse Ever

I am pretty sure this qualifies as the worst abuse of a compiler I can think of. Note, I am not recommending you use this in production code, lest you wish to be set on fire by those who have to maintain or use your code. Yes, it is that bad.
Continue reading

Posted in C/C++ | Leave a comment

I Learned Something New About New

In my last post, I had mentioned that I found a phenomenon that made no sense to me. It had to do with initializing the members of a structure when calling new. Since I can’t let sleeping dogs lie, I went on an adventure to find my answers and I’d like to share what I found.
Continue reading

Posted in C/C++ | Tagged , , , | 1 Comment