15 May 2001 ksandstr   » (Journeyer)

Free hint: Don't use idempotent_function(foo) in the second part of a for() construct in C (probably applies to C++ as well) if you intend to change whatever it is that foo points to during the loop. You see, the compiler may perform the idempotent_function() call just once, leaving you eating sand if you, for example, chop the last character off the end of the string on every iteration. Ugh.

Not declaring any functions G_GNUC_CONST that take arguments by reference would probably help limit damage here.

Indeed, D. Knuth was right -- premature optimization is the root of all evil.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!