Monthly Archives: June 2011

No, It's Not OK

The code below is broken in a subtle way. There’s no way to know that ptr is aligned on a boundary that your CPU architecture may require. And I don’t think there is any way to know until runtime. Oh, … Continue reading

Posted in Code, Geek | Leave a comment

Mixing Static and Dynamic Linkage

Using GNU tools you can mix static and dynamic linkage using: gcc foo.o -Wl,-Bstatic -lstatic1 -lstatic2 -Wl,-Bdynamic -ldynamic1 Just be careful. The way the linker resolves symbols in static libraries is not what you might expect. It would be nice … Continue reading

Posted in Geek, Tips | Leave a comment