Enable compiler warnings

This commit enables compiler warnings, disables some somewhat-harmless warnings
which we encounter often throughout the codebase (for now), and sets warning 33
('Unused open') to 'error'.

Next to enabling the compiler flags, fixes for unused open statements are made
as well.