Posts

  • Reordering Arguments

    When a C program runs, it usually receives any command-line arguments through the parameters argc (argument count) and argv (argument vector). It is up to the program to interpret the contents of this array of strings.

  • Moving to Jekyll

    I am moving this blog to Jekyll. While WordPress has worked quite well for the past seven years, I feel it is too much effort for a site that might as well be static.

  • Not Quite Monokai

    TextMate is a popular text editor for OS X. Since the first release 10 years ago, a lot of people have contributed color themes, many of which have been ported to other editors.

  • Time Difference

    This post is based on a discussion about Progress Bars of Life, where I was foolish enough to claim that printing a text string representing the difference between two times could not be that hard in C. It is not hard, but turned out not to be entirely trivial either.

  • Move Semantics Podcast

  • Long Division, Part 3

    The CLR runtime contains optimizations for certain values (usually when both operands fit in 32 bits), but for other cases optimizing the C runtime functions appears to provide a direct improvement for the CLR as well.
  • Move to Parent

    Moving folders is one of those tasks that appear trivial. But as always, the devil is in the details.
  • Quoting Command-line Arguments

    Looking at the two code excerpts, one could wonder if the old handling was in fact just a bug introduced by the else part not being in braces, and left in for over ten years. Or maybe it was intentional, and the change in Visual C++ 8.0 was to support the way two quotes are used as escape in other languages.
  • Long Division, Part 2

    To my surprise, I found the GCD test I wrote for Long Division ran faster when compiled with WCRT.
  • Long Division

    Integer types with at least 64 bits have been a part of the C standard for a while now (they were added in C99, and were a standard extension in many 32-bit compilers before that). But have you ever wondered what exactly happens when you use them?

  • INT_MIN

    So what exactly is wrong with the integer constant -2147483648 ?
  • System Up Time

    A while ago I set out to write a little tool that would show the time a system had been running since the last reboot. It seemed like something that should be fairly easy to do, but as it turns out, it isn’t entirely straightforward.

  • Padding Trouble

    When building the aPLib compression library, I use Visual C++ to generate assembly listings, which I then perform some changes on with a Perl script, before assembling the object files. While working on the recently released 64-bit version, I ran into a problem -- the debug build of the library worked fine, but the release build did not.
  • Still Hard to C

  • What Else Could Go Wrong?

    JrDebugLogger is a very nice debug logging library. Much of it’s functionality is implemented through macros to allow it to be selectively left out when compiling. Along the way the author has had some interesting problems to solve, and this post is about one of them.

  • Ternary Trickery

  • Loophole in Visual C++, Part 2

    The program works as expected on the compilers I tried, except for cl.exe from VC7 and VC71 with the /O2 switch, which stop at 25%.
  • Additional Trouble

    2 plus 2 is 4, but does that generalize?

  • Loophole in Visual C++, Part 1

    However, if you compile it with cl.exe from Visual C++ using the /O2 switch (maximize speed) you get a somewhat surprising result; a single zero and the program exits.
  • Herb Sutter on Visual C++

subscribe via RSS