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

Fix build failure due to -Werror=calloc-transposed-args #3404

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

dzil123
Copy link
Contributor

@dzil123 dzil123 commented Jun 5, 2024

lib/tpm2_openssl.c: In function ‘do_open_file’:
lib/tpm2_openssl.c:433:31: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  433 |     char *tmp = calloc(sizeof(char), file_size + 1);
      |                               ^~~~
lib/tpm2_openssl.c:433:31: note: earlier argument should specify number of elements, later size of each element
lib/tpm2_openssl.c: In function ‘do_stdin’:
lib/tpm2_openssl.c:488:31: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  488 |     void *buf = calloc(sizeof(BYTE), UINT16_MAX + 1);
      |                               ^~~~
lib/tpm2_openssl.c:488:31: note: earlier argument should specify number of elements, later size of each element

@JuergenReppSIT
Copy link
Member

@dzil123 Could you please rebase your PR. The checks in the CI should not fail afterwards.

@dzil123 dzil123 force-pushed the fix-calloc-order branch from 55cc473 to 6070cba Compare June 11, 2024 16:06
@dzil123
Copy link
Contributor Author

dzil123 commented Jun 11, 2024

Rebased

@JuergenReppSIT
Copy link
Member

Thank you for rebasing. Could you please also sign the commit.
To avoid having PRs blocked in the future, please always include Signed-off-by: Author Name [email protected] in every commit message. You can also do this automatically by using the -s flag (i.e., git commit -s).

@dzil123 dzil123 force-pushed the fix-calloc-order branch from 6070cba to 0c45910 Compare June 12, 2024 00:31
@JuergenReppSIT JuergenReppSIT self-requested a review June 12, 2024 07:19
@JuergenReppSIT JuergenReppSIT merged commit 1dfb151 into tpm2-software:master Jun 12, 2024
16 checks passed
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.

2 participants