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

Initialize vars & change types to appease Windows/VS #8181

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

gojimmypi
Copy link
Contributor

@gojimmypi gojimmypi commented Nov 13, 2024

Description

Addresses these warnings encountered during a Windows / Visual Studio build:

  • edit: also introduces #define WOLFSSL_MAX_8BIT 0xffU in type.h
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\src\dtls.c(721,36): warning C4244: 'function': conversion from 'word32' to 'word16', possible loss of data
1>C:\workspace\wolfssl\src\dtls.c(732,67): warning C4244: 'function': conversion from 'word32' to 'word16', possible loss of data
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\src\ssl_sess.c(3891,46): warning C4244: '=': conversion from 'int' to 'word16', possible loss of data
1>C:\workspace\wolfssl\src\ssl_sess.c(4167,22): warning C4244: '=': conversion from 'unsigned int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\ssl_sess.c(4183,23): warning C4244: '=': conversion from 'unsigned int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\ssl_asn1.c(288,36): warning C4244: 'function': conversion from 'const int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\bio.c(1382,25): warning C4244: '=': conversion from 'int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\x509.c(1476,59): warning C4244: '=': conversion from 'int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\ssl_p7p12.c(951,21): warning C4245: 'initializing': conversion from 'int' to 'word32', signed/unsigned mismatch
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\src\tls13.c(4036,17): warning C4244: 'function': conversion from 'word32' to 'word16', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(6316,20): warning C4244: '=': conversion from 'word32' to 'word16', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(10862,39): warning C4244: '=': conversion from 'word32' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(10866,39): warning C4244: '=': conversion from 'word32' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(11036,39): warning C4244: '=': conversion from 'int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(11040,39): warning C4244: '=': conversion from 'int' to 'byte', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(11949,49): warning C4244: 'function': conversion from 'int' to 'word16', possible loss of data
1>C:\workspace\wolfssl\src\tls13.c(11949,57): warning C4244: 'function': conversion from 'word32' to 'word16', possible loss of data
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfcrypt\src\asn.c(13614,1): warning C4701: potentially uninitialized local variable 'finalName' used
1>C:\workspace\wolfssl\wolfcrypt\src\asn.c(13614,1): warning C4703: potentially uninitialized local pointer variable 'finalName' used
1>C:\workspace\wolfssl\src\pk.c(3666,1): warning C4701: potentially uninitialized local variable 'hashType' used
1>C:\workspace\wolfssl\src\pk.c(7961,1): warning C4701: potentially uninitialized local variable 'derSz' used
1>C:\workspace\wolfssl\src\pk.c(16559,1): warning C4701: potentially uninitialized local variable 'curveOid' used
1>C:\workspace\wolfssl\src\pk.c(16559,1): warning C4703: potentially uninitialized local pointer variable 'curveOid' used
1>C:\workspace\wolfssl\src\ssl_load.c(5045,1): warning C4701: potentially uninitialized local variable 'derSize' used
1>C:\workspace\wolfssl\src\pk.c(7901,1): warning C4701: potentially uninitialized local variable 'derSz' used
1>C:\workspace\wolfssl\src\pk.c(16607,1): warning C4701: potentially uninitialized local variable 'keySz' used
1>C:\workspace\wolfssl\wolfssl\wolfcrypt\curve25519.h(151,1): warning C4141: 'dllexport': used more than once
1>C:\workspace\wolfssl\wolfcrypt\src\dsa.c(176,5): warning C4003: not enough arguments for function-like macro invocation 'SAVE_VECTOR_REGISTERS'
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12596,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12597,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12598,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12599,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12600,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12601,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12608,74): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(12609,48): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(13590,1): warning C4701: potentially uninitialized local variable 'mp' used
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(13275,1): warning C4701: potentially uninitialized local variable 'mp' used
1>C:\workspace\wolfssl\wolfcrypt\src\ecc.c(13413,1): warning C4701: potentially uninitialized local variable 'mp' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(13303,1): warning C4701: potentially uninitialized local variable 'tag' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(14151,1): warning C4701: potentially uninitialized local variable 'tag' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(14219,1): warning C4701: potentially uninitialized local variable 'version' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(5513,1): warning C4701: potentially uninitialized local variable 'outerContentType' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(12110,1): warning C4701: potentially uninitialized local variable 'length' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(12000,1): warning C4701: potentially uninitialized local variable 'contentType' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(12013,1): warning C4701: potentially uninitialized local variable 'tag' used
1>C:\workspace\wolfssl\wolfcrypt\src\pkcs7.c(5177,1): warning C4701: potentially uninitialized local variable 'length' used
  • edit: This PR does not include fixes for the warning C4141: 'dllexport': used more than once, noted above.

Fixes zd# n/a

Testing

Confirmed working with benchmark and test apps.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

src/bio.c Outdated Show resolved Hide resolved
src/dtls.c Outdated Show resolved Hide resolved
src/ssl_asn1.c Outdated Show resolved Hide resolved
src/ssl_sess.c Outdated Show resolved Hide resolved
src/ssl_sess.c Outdated Show resolved Hide resolved
src/tls13.c Outdated Show resolved Hide resolved
src/tls13.c Outdated Show resolved Hide resolved
src/x509.c Outdated Show resolved Hide resolved
src/x509.c Outdated Show resolved Hide resolved
@gojimmypi gojimmypi force-pushed the dev-compiler-message branch from 7791535 to 028195d Compare November 13, 2024 23:43
@gojimmypi gojimmypi requested a review from SparkiDev November 13, 2024 23:46
@gojimmypi gojimmypi force-pushed the dev-compiler-message branch 4 times, most recently from 2ad9df3 to 8e4cc38 Compare November 14, 2024 18:10
@gojimmypi
Copy link
Contributor Author

Jenkins retest this please

@dgarske dgarske assigned SparkiDev and unassigned gojimmypi Nov 15, 2024
dgarske
dgarske previously approved these changes Nov 15, 2024
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Nice cleanups and extra checks. Passes my review and testing. Over to @SparkiDev to finalize.

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

Mostly looks good! Had a few nits and a question or two.

src/bio.c Outdated Show resolved Hide resolved
src/bio.c Outdated Show resolved Hide resolved
src/ssl_asn1.c Outdated Show resolved Hide resolved
src/ssl_asn1.c Outdated Show resolved Hide resolved
src/tls13.c Outdated Show resolved Hide resolved
wolfcrypt/src/dsa.c Show resolved Hide resolved
@gojimmypi gojimmypi force-pushed the dev-compiler-message branch from 2f04bf0 to 5d86031 Compare November 18, 2024 01:50
@dgarske dgarske assigned wolfSSL-Bot and unassigned douzzer and gojimmypi Nov 18, 2024
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

This all landed in a good place. Thanks @gojimmypi !

@douzzer douzzer merged commit 22e9508 into wolfSSL:master Dec 17, 2024
143 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants