Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd5adbc

Browse filesBrowse files
danbevaddaleax
authored andcommitted
src: fix node_crypto.cc compiler warnings
Currently the following compiler warnings are issued by clang: ../src/node_crypto.cc:2801:56: warning: '&&' within '||' [-Wlogical-op-parentheses] return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16; ~~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ../src/node_crypto.cc:2801:56: note: place parentheses around the '&&' expression to silence this warning return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16; ^ ../src/node_crypto.cc:2925:51: warning: '&&' within '||' [-Wlogical-op-parentheses] if (cipher->auth_tag_len_ != kNoAuthTagLength && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ ../src/node_crypto.cc:2925:51: note: place parentheses around the '&&' expression to silence this warning if (cipher->auth_tag_len_ != kNoAuthTagLength && ^ This commit adds parenthesis around these expressions to silence the warnings. Backport-PR-URL: #20706 PR-URL: #20216 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5ea1a58 commit fd5adbc
Copy full SHA for fd5adbc

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
27912791

27922792

27932793
static bool IsValidGCMTagLength(unsigned int tag_len) {
2794-
return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16;
2794+
return tag_len == 4 || tag_len == 8 || (tag_len >= 12 && tag_len <= 16);
27952795
}
27962796

27972797
bool CipherBase::InitAuthenticated(const char *cipher_type, int iv_len,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.