arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
395 stars 111 forks source link

Fixed many warnings that appear due to assert not being executed in release mode. #23

Closed TheQuantumPhysicist closed 6 years ago

TheQuantumPhysicist commented 6 years ago

Like I said before, I don't prefer to see any warnings. I even don't like seeing assert() because it's the source of evil. Check the cryptocurrency EOS, and their huge bug that was announced yesterday, which was not found due to using assert().

I haven't removed the asserts, btw. I just found ways to avoid getting all these warnings. So please remove them at your convenience.

Alternatively, I suggest throwing exceptions instead of assert()ing. I believe that an error is an error. It's not just an error only in debug mode. What is it gonna cost? Another boolean comparison? In a JWT implementation that's nothing. You don't want to get into the mess of build systems and their considerations of what's debug mode and what's otherwise.

arun11299 commented 6 years ago

I will create an issue for removing the asserts.