The code size includes the code of any module, not just user modules. As the user modules using more than 31k, it just needs a little bit of the ANSI library to go over 32k (and depending on the code, it might use a lot of the ANSI library). Check the map file, I think it gets created in those cases too and it should show what got allocated.
Daniel