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

libkae: fix build warning on aarch64 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

parheliamm
Copy link

This patch to fix below error on aarch64
[ 34s] ./utils/engine_log.h:73:13: error: ignoring return value of 'ftruncate' declared with attribute 'warn_unused_result' [-Werror=unused-result]
[ 34s] 73 | ftruncate(g_kae_debug_log_file->_fileno, 0);
[ 34s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[ 84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_private_encrypt':
[ 84s] alg/pkey/hpre_rsa.c:546:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ 84s] 546 | hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[ 84s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_public_encrypt':
[ 84s] alg/pkey/hpre_rsa.c:440:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ 84s] 440 | hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[ 84s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 84s] alg/pkey/hpre_rsa.c:440:5: error: 'bn_ctx' may be used uninitialized in this function [-Werror=maybe-uninitialized]

There is no functional change.

Signed-off-by: Chenxi Mao [email protected]

This patch to fix below error on aarch64
[   34s] ./utils/engine_log.h:73:13: error: ignoring return value of 'ftruncate' declared with attribute 'warn_unused_result' [-Werror=unused-result]
[   34s]    73 |             ftruncate(g_kae_debug_log_file->_fileno, 0);                                                \
[   34s]       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[   84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_private_encrypt':
[   84s] alg/pkey/hpre_rsa.c:546:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   84s]   546 |     hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[   84s]       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_public_encrypt':
[   84s] alg/pkey/hpre_rsa.c:440:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   84s]   440 |     hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[   84s]       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   84s] alg/pkey/hpre_rsa.c:440:5: error: 'bn_ctx' may be used uninitialized in this function [-Werror=maybe-uninitialized]

There is no functional change.

Signed-off-by: Chenxi Mao <[email protected]>
@it-is-a-robot
Copy link

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

The following commits have not yet signed CLA.

f3735b0 | libkae: fix build warning on aarch64

This patch to fix below error on aarch64
[ 34s] ./utils/engine_log.h:73:13: error: ignoring return value of 'ftruncate' declared with attribute 'warn_unused_result' [-Werror=unused-result]
[ 34s] 73 | ftruncate(g_kae_debug_log_file->_fileno, 0);
[ 34s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[ 84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_private_encrypt':
[ 84s] alg/pkey/hpre_rsa.c:546:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ 84s] 546 | hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[ 84s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 84s] alg/pkey/hpre_rsa.c: In function 'hpre_rsa_public_encrypt':
[ 84s] alg/pkey/hpre_rsa.c:440:5: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ 84s] 440 | hpre_free_bn_ctx_buf(bn_ctx, in_buf, num_bytes);
[ 84s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 84s] alg/pkey/hpre_rsa.c:440:5: error: 'bn_ctx' may be used uninitialized in this function [-Werror=maybe-uninitialized]

There is no functional change.

Signed-off-by: Chenxi Mao [email protected]

📝 Please access here to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment: /check-cla to verify. Thanks.


  • If you've already signed a CLA, it's possible you're using a different email address for your gitee account. Check your existing CLA data and verify the email.
  • If you signed the CLA as an employee or a member of an organization, please contact your corporation or organization to verify you have been activated to start contributing.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please feel free to file an issue.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants