Use unsigned integers in SDS header.

This raises the max string to 4GB without any downside.
Add -W to compilation flags.
Remove warnings and improve integer sign correctness.