This is the infamous const char * fix that must be applied by anyone using gcc (or g++) 4.2 or higher.
Most of the fixes here involve making as may strings constant as possible, although there are a few places where local copies are now made, and there's one dirty trick used in str_dup.