The thrill of exploration – that feeling of satisfaction in discovering new views, or achievement in porting more software – can be tempered by the horrors that may be found across the newly opened frontier. Today I sat down and patched up the OpenSSL detection in kdelibs (OpenSSL lives in /usr/sfw where we normally don’t want to look because of old versions of other software that lives there too). That was pretty painless, except maybe where the CMake macros FIND_PATH and FIND_LIBRARY use inconsistent macro arguments. Huzzah, OpenSSL is found. Only the 32-bit version, though – I’m not brave enough to try to massage the KDE build into both 32- and 64-bit versions yet. So what new horizons do we see?

Well, lots of pointer-to-function casting problems. Sun Studio considers pointers with extern “C” and C++ linkage different enough to issue a warning. The warning occurs when you try to assign an int ()() to a variable of type extern “C” int()(). And if you are assigning function pointers with function-pointer arguments, the warning gets raised to an error. This program illustrates the issue:

extern "C" {
        int foo() { return 0; }
        int bar(int (*f)()) { return f() + 1; }

int main(int argc, char **argv) {
        int (*f)();
        int (*g)(int (*)());
        f = foo;
        g = bar;
        return g(f);

This compiles with no warnings with GCC, but with Sun Studio 12 you get

"t.cpp", line 17: Warning (Anachronism): Assigning extern "C" int(*)() to int(*)().
"t.cpp", line 18: Error: Cannot assign extern "C" int(*)(extern "C" int(*)()) to int(*)(int(*)())

I’m really not sure why one is a warning and the other an error. To know that I’d have to check closely the calling conventions and I’m not really in a mood to do that. Suffice to say that adding a typedef for extern “C” int() functions allows me to specify the types so that it satisfies the compiler. For KSSL there’s four typedefs needed to get it up and running. And then – a second sigh of satisfaction in the morning – KDE4 supports SSL on Solaris. So I can read my https based web-pages again.

And what thorns await on this side of the hill? Well, it seems the Konqueror HTML rendering has gone totally insane as it renders only backgrounds and those very tall. So that part is still very problematic. I’ve got a desktop pager overlapping the system tray bits. There’s a new plasma-themed throbber at the end of my panel (this sounds like a good line for spam mail, really) that I don’t know what it does but I imagine it will become clear in time. Starting firefox from alt-f2 crashes krunner. But all these thorny thickets don’t obscure the long-range view: it’s beautiful and Free out here.

[[ Thanks to John Levon pointing out that my grep skills suck; I moved okular’s chm support to the more standard uint types and now all of kdegraphics builds again. Having an okular that displays PDFs might not be a great leap for Mankind, but it’s certainly useful on the desktop. ]]