Category Archives: Visual Studio

Making Compiles Slow Through Abuse of Templates

I’m planning a post on how to maximize build parallelism in VC++, but first I needed to create a simple project that was slow to compile. Creating such a program was an interesting exercise in its own right and I … Continue reading

Posted in Performance, Programming, Visual Studio | Tagged , , | 18 Comments

VC++ 2013 class Layout Change and Wasted Space

The VC++ compiler generally maintains a high degree of binary compatibility between compiler versions, allowing objects to be passed between DLLs made with different compiler versions. However VS 2013 made changes to the layouts of some classes in 64-bit builds. … Continue reading

Posted in Programming, Visual Studio | Tagged , , | 13 Comments

std::min Causing Three-Times Slowdown on VC++

Using macros to implement Min and Max has numerous well known pitfalls that can be avoided by using template functions. However the definitions of min and max that are mandated by the C++ standard cause VC++ to generate inefficient code. … Continue reading

Posted in Performance, Programming, Visual Studio | Tagged , | 44 Comments

How to Report a VC++ Code-Gen Bug

My coworkers recently found a bug in the x64 code generated by Visual C++. This bug exists in VC++ 2010 to VC++ 2013 RC. We put in a workaround (the traditional one of disabling optimizations for the afflicted function) and … Continue reading

Posted in Bugs, Investigative Reporting, Programming, Visual Studio | Tagged , , | 10 Comments

Vote for the VC++ Improvements That Matter

VS 2013 is almost done and VS 2014 is being planned and I’ve been pushing for the VC++ features/bug-fixes that matter most to me. I’ve come up with two requests that seem plausible and valuable. If you like them then … Continue reading

Posted in Code analysis, Programming, Visual Studio | Tagged , | 10 Comments

Developers Rejoice Again

Just a few short weeks ago I recommended that all developers running 64-bit Windows 7 (that is, most developers) should install a hot-fix to correct a stack corruption bug that would hit anytime a 32-bit program crashed in the debugger … Continue reading

Posted in Code Reliability, Programming, Visual Studio | Tagged , , , , , | 1 Comment

Developers Rejoice–Windows 7 Stack Corruption Fixed!

64-bit Windows 7 SP1 has a stack corruption bug that affects developers. Any developer with an AVX capable processor who is writing 32-bit code on 64-bit Window 7 SP1 is vulnerable. That sounds like a lot of conditions but I … Continue reading

Posted in Code Reliability, Programming, Visual Studio | Tagged , , , , , | 17 Comments

50 Bytes of Code That Took 4 GB to Compile

While doing evil things with macros and the inline assembler (trying to run a weird test whose purpose is not really relevant) I managed to write a program that caused Visual Studio’s C++ compiler to allocate 4 GB of memory … Continue reading

Posted in Investigative Reporting, Programming, Visual Studio, xperf | Tagged | 37 Comments

Floating-Point Determinism

Is IEEE floating-point math deterministic? Will you always get the same results from the same inputs? The answer is an unequivocal “yes”. Unfortunately the answer is also an unequivocal “no”. I’m afraid you will need to clarify your question. My … Continue reading

Posted in Floating Point, Visual Studio | Tagged | 65 Comments

Two Years (and Thousands of Bugs) of Static Analysis

I’ve been running static code analysis on four large code bases for over two years now. After the initial work of looking through all of the warnings and fixing the serious bugs I put the projects into code analysis maintenance … Continue reading

Posted in Code analysis, Code Reliability, Programming, Visual Studio | Tagged , , , | 22 Comments