rogerbinns / apsw

Another Python SQLite wrapper
https://rogerbinns.github.io/apsw/
Other
740 stars 97 forks source link

Reduce the number of compiler warnings on an MSVC build #181

Closed desb42 closed 6 years ago

desb42 commented 9 years ago

if the preprocessor flags _CRT_SECURE_NO_WARNINGS and HAVE_ROUND are set for a Microsoft Visual C build this will reduce the number of compile time warnings.

In my tests with _CRT_SECURE_NO_WARNINGS set the only compiler warning I get on building the sqlite amalgam is in debug mode - one of the asserts has a small issue

When building apsw a further conflict occurs with Python's definition of round. Using the HAVE_ROUND flag removes this warning

I fixed this for myself by hacking setup.py and adding the flags for all builds - as I am only using MSVC thats sort of OK. But is not really the correct fix

rogerbinns commented 9 years ago

I don't intend to add the no warnings flag. The warnings produced are stupid - a fixed length string is copied into a larger fixed length buffer, and will obviously fit. (The compilers on Unix and Mac are smart enough to see that and not complain.) I hadn't seen the round issue before and will need to investigate. Note that the vast majority of Windows users use the provided binaries so they won't see any messages.

For Windows 5 different compilers are used so making any changes has to be carefully investigated first. These are gcc/mingw 32 bit, VS 2008 32 bit, Windows Resource Kit 7.0 64 bit, VS 2010 32 bit, Windows Resource Kit 7.1 64 bit.

rogerbinns commented 6 years ago

I'm not going to do anything about this since I can't test