Skip to content

Conversation

fishilico
Copy link

Hello,

First, thank you for making this code public! It is quite helpful and it is nice to have cryptographic functions implemented in a way which does not require integrating a large library.

I am using it in a project which I build with clang and many compiler warning files. When doing this, several warnings are emitted due to using macros as statements ending with a semicolon:

WjCryptLib/lib/WjCryptLib_Aes.c:899:31: warning: empty expression
statement has no effect; remove unnecessary ';' to silence this
warning [-Wextra-semi-stmt]
    STORE32H( s2, Output + 8 );
                              ^

Here is a Pull Request which introduces do { ... } while (0) constructions in the macros which are used like function calls. If you prefer silencing these warnings in another way, I am open to discussion.

Thanks

When building the library with clang, several warnings are emitted due
to using macros as statements ending with a semicolon:

    WjCryptLib/lib/WjCryptLib_Aes.c:899:31: warning: empty expression
    statement has no effect; remove unnecessary ';' to silence this
    warning [-Wextra-semi-stmt]
        STORE32H( s2, Output + 8 );
                                  ^

Instead of removing all the semicolons, introduce `do { ... } while (0)`
construction in the macros which are used like function calls.
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.

1 participant