Added warning related compilation flags and fixed related errors.

Hello, thanks for your great library !
I added some compilation flags and tested this with g++ under linux.
Several issues were encountered.
-pedantic is not necessary for normal building. I think -Wall is sufficient. Besides, many of the errors generated by -pedantic are excessive, especially with regards to C++11.