Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ALL compiler warnings #222

Closed
wants to merge 8 commits into from
Closed

Conversation

frankmorgner
Copy link
Member

I fixed all compiler warnings from clang/gcc. If someone wants to use OpenSC in a productive environment, the least thing you want to do is to check the compiler warnings! (If you are Apple you might even want to turn on more warnings that usual... otherwise you goto fail).

In the process I found and fixed some critical bugs. Especially pkcs15init_initialize from src/pkcs11/framework-pkcs15init.c needs a rewrite as it implements a wrong prototype (see c18ec388bc29b9a084d5b1ebbaff69098f5a6ddb).

Also, we should start to agree upon some coding rules. The first, I want to add is to treat compiler warnings as errors!

Frank Morgner added 6 commits March 2, 2014 11:33
Signed-off-by: Frank Morgner <[email protected]>
Signed-off-by: Frank Morgner <[email protected]>
resolve the FIXME if you want to use this function

Signed-off-by: Frank Morgner <[email protected]>
Signed-off-by: Frank Morgner <[email protected]>
@martinpaljak
Copy link
Member

Wow. Nice work!

For various reasons previous efforts to establish (and maintain!) some kind of coherent coding standard (in addition to minimal meaningful code review that would help to assure it) has not been successful with OpenSC.

But given that you fixed ALL (will check in a sec!) existing warnings beforehand, there is way better chance this time. Have you also checked with MSVC?

@frankmorgner
Copy link
Member Author

On Sunday, March 02 at 03:50AM, Martin Paljak wrote:

Wow. Nice work!

For various reasons previous efforts to establish (and maintain!) some kind of coherent coding standard (in addition to minimal meaningful code review that would help to assure it) has not been successful with OpenSC.

I think we now have a starting point. -Werror should be added to any CI,
so that patches with warnings are not allowed.

But given that you fixed ALL (will check in a sec!) existing warnings beforehand, there is way better chance this time. Have you also checked with MSVC?

Nope, gcc and clang only, sorry. Is there a build script for visual
studio?

Greets, Frank.

@bscottm
Copy link

bscottm commented Apr 3, 2014

I submitted something similar a year ago, but ran into significant friction. Good to see that these have finally been addressed.

@bscottm
Copy link

bscottm commented Apr 3, 2014

Suggestion: Instead of casts to (unsigned char *), probably better if (void *) were used in call sites like memcpy() and free().

@viktorTarasov
Copy link
Member

Major part submitted. Will try to do the remaining part.
Slightly touched the 'westcos' patch.

5f45739 fixed one more warning
e1fd9d2 cardos,incrypto34: restored semantics of select_pin_reference
511c8e6 dnie: dont ignore error on sm free operation
b483d1d westcos: fixed initialization of driver data
3b50ccc fixed incompatible function usage
a64326e fixed compiler warnings (partially submitted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants