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

116: is not gcc 14.x ready (buid fails with [-Werror=calloc-transposed-args]) #117

Closed
kloczek opened this issue Feb 1, 2024 · 1 comment · Fixed by #119
Closed

116: is not gcc 14.x ready (buid fails with [-Werror=calloc-transposed-args]) #117

kloczek opened this issue Feb 1, 2024 · 1 comment · Fixed by #119

Comments

@kloczek
Copy link

kloczek commented Feb 1, 2024

Looks like last version build fails with latest gcc 14.x which is now used in fedora rawhide.

Build fails with
/usr/bin/gcc -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os  -Wall -Wextra -Wsign-compare -Wno-unused-result -Wno-unused-function -Wno-missing-field-initializers  -Werror -Wno-error=cpp -Wno-free-nonheap-object -std=gnu11 -fshort-wchar -fPIC -fno-strict-aliasing -D_GNU_SOURCE -DCONFIG_x86_64 -I/home/tkloczko/rpmbuild/BUILD/pesign-116/include '-DRUNDIR="/run/"'     -I/usr/include/efivar -I/usr/include/nss3 -I/usr/include/nspr4 -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -c -o pesigcheck.o pesigcheck.c
pesigcheck.c: In function ‘check_signature’:
pesigcheck.c:243:34: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  243 |         reasonps = calloc(sizeof(struct reason), 512);
      |                                  ^~~~~~
pesigcheck.c:243:34: note: earlier argument should specify number of elements, later size of each element
pesigcheck.c:284:53: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  284 |                         new_reasons = calloc(sizeof(struct reason), num_reasons);
      |                                                     ^~~~~~
pesigcheck.c:284:53: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors
@kloczek
Copy link
Author

kloczek commented Feb 4, 2024

Tested and it OK now.
Thank you 👍

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 a pull request may close this issue.

1 participant