Skip to content

Conversation

@karel-m
Copy link
Member

@karel-m karel-m commented Jun 22, 2018

The warnings:

libtomcrypt/src/ciphers/blowfish.c:583:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 56) {
     ^~~~~~~~
libtomcrypt/src/ciphers/cast5.c:710:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 16) {
     ^~~~~~~~
libtomcrypt/src/ciphers/kasumi.c:246:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/khazad.c:846:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/noekeon.c:317:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/rc2.c:404:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 128) {
     ^~~~~~~~
libtomcrypt/src/ciphers/rc5.c:311:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 128) {
     ^~~~~~~~
libtomcrypt/src/ciphers/rc6.c:321:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 128) {
     ^~~~~~~~
libtomcrypt/src/ciphers/skipjack.c:333:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize > 10) {
     ^~~~~~~~
libtomcrypt/src/misc/error_to_string.c:71:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/aes/aes.c:731:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize < 32) {
     ^~~~~~~~
libtomcrypt/src/ciphers/safer/safer.c:361:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/safer/safer.c:372:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/ciphers/twofish/twofish.c:697:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (*keysize < 32) {
     ^~~~~~~~
libtomcrypt/src/mac/hmac/hmac_test.c:617:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (tested == 0) {
      ^~~~~~~~
libtomcrypt/src/misc/base64/base64_decode.c:109:11: warning: do not use 'else' after 'return' [readability-else-after-return]
          else
          ^~~~
libtomcrypt/src/misc/base64/base64_decode.c:115:11: warning: do not use 'else' after 'continue' [readability-else-after-return]
          else
          ^~~~
libtomcrypt/src/misc/hkdf/hkdf.c:33:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/misc/hkdf/hkdf_test.c:281:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (tested == 0) {
      ^~~~~~~~
libtomcrypt/src/modes/cbc/cbc_decrypt.c:61:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/modes/cbc/cbc_encrypt.c:55:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/modes/ecb/ecb_decrypt.c:42:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/modes/ecb/ecb_encrypt.c:42:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/pk/dh/dh_generate_key.c:22:4: warning: do not use 'else' after 'return' [readability-else-after-return]
   else if (groupsize <= 192) {
   ^~~~~~~~
libtomcrypt/src/pk/dsa/dsa_export.c:58:7: warning: do not use 'else' after 'return' [readability-else-after-return]
      else {
      ^~~~~~
libtomcrypt/src/pk/dsa/dsa_export.c:97:7: warning: do not use 'else' after 'return' [readability-else-after-return]
      else {
      ^~~~~~
libtomcrypt/src/pk/ecc/ecc_get_curve.c:213:4: warning: do not use 'else' after 'return' [readability-else-after-return]
   else
   ^~~~
libtomcrypt/src/pk/rsa/rsa_export.c:55:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/stream/rabbit/rabbit.c:300:8: warning: do not use 'else' after 'return' [readability-else-after-return]
     } else {
       ^~~~~~
libtomcrypt/src/pk/asn1/der/general/der_decode_asn1_length.c:44:9: warning: do not use 'else' after 'return' [readability-else-after-return]
      } else if (real_len > sizeof(decoded_len)) {
        ^~~~~~~~
libtomcrypt/src/pk/asn1/der/general/der_encode_asn1_identifier.c:44:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c:115:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (buf[x] == '.') {
      ^~~~~~~~
libtomcrypt/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c:130:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (buf[x] == '+' || buf[x] == '-') {
      ^~~~~~~~
libtomcrypt/src/pk/asn1/der/set/der_encode_set.c:36:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else {
     ^~~~~~
libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c:98:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (buf[x] == '+' || buf[x] == '-') {
      ^~~~~~~~
libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c:111:7: warning: do not use 'else' after 'return' [readability-else-after-return]
    } else if (buf[x] == '+' || buf[x] == '-') {
      ^~~~~~~~
libtomcrypt/src/pk/asn1/der/utf8/der_length_utf8_string.c:26:6: warning: do not use 'else' after 'return' [readability-else-after-return]
   } else if (c <= 0x7FF) {
     ^~~~~~~~

@karel-m karel-m force-pushed the pr/clang-tidy-else-after-return branch from 55d5eb6 to dde44ea Compare June 22, 2018 22:02
@karel-m karel-m requested a review from sjaeckel June 22, 2018 22:53
@karel-m karel-m force-pushed the pr/clang-tidy-else-after-return branch from dde44ea to e0f92b6 Compare July 3, 2018 08:14
Copy link
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool PR

would you mind adding a script to the repo (probably in .ci/) that can be run on request to re-analyze all those warnings?

@karel-m karel-m force-pushed the pr/clang-tidy-else-after-return branch from e0f92b6 to ed2ec2e Compare July 3, 2018 20:43
@karel-m
Copy link
Member Author

karel-m commented Jul 3, 2018

would you mind adding a script to the repo (probably in .ci/) that can be run on request to re-analyze all those warnings?

see .ci/clang-tidy.sh

@karel-m karel-m merged commit 4473953 into develop Jul 3, 2018
@karel-m karel-m deleted the pr/clang-tidy-else-after-return branch July 3, 2018 20:45
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.

3 participants