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

Update pnginfo.c to fix build failure #20

Merged
merged 1 commit into from
May 7, 2023

Conversation

LocutusOfBorg
Copy link
Contributor

Fix build failure with newer compilers and glibc and security flags:
gcc -DPACKAGE_NAME="pngtools" -DPACKAGE_TARNAME="pngtools" -DPACKAGE_VERSION="0.4-dev" -DPACKAGE_STRING="pngtools\ 0.4-dev" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="pngtools" -DVERSION="0.4-dev" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_PNG_H=1 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -c -o pngread.o pngread.c
pnginfo.c: In function 'pnginfo_displayfile':
pnginfo.c:419:33: error: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Werror=format=]
419 | printf ("* %d ", runlen);
| ~^ ~~~~~~
| | |
| int long unsigned int
| %ld
gcc -DPACKAGE_NAME="pngtools" -DPACKAGE_TARNAME="pngtools" -DPACKAGE_VERSION="0.4-dev" -DPACKAGE_STRING="pngtools\ 0.4-dev" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="pngtools" -DVERSION="0.4-dev" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_PNG_H=1 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -c -o pngwrite.o pngwrite.c

Fix build failure with newer compilers and glibc and security flags:
gcc -DPACKAGE_NAME=\"pngtools\" -DPACKAGE_TARNAME=\"pngtools\" -DPACKAGE_VERSION=\"0.4-dev\" -DPACKAGE_STRING=\"pngtools\ 0.4-dev\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pngtools\" -DVERSION=\"0.4-dev\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_PNG_H=1 -I.   -Wdate-time -D_FORTIFY_SOURCE=2  -Werror -c -o pngread.o pngread.c
pnginfo.c: In function 'pnginfo_displayfile':
pnginfo.c:419:33: error: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Werror=format=]
  419 |                     printf ("* %d ", runlen);
      |                                ~^    ~~~~~~
      |                                 |    |
      |                                 int  long unsigned int
      |                                %ld
gcc -DPACKAGE_NAME=\"pngtools\" -DPACKAGE_TARNAME=\"pngtools\" -DPACKAGE_VERSION=\"0.4-dev\" -DPACKAGE_STRING=\"pngtools\ 0.4-dev\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pngtools\" -DVERSION=\"0.4-dev\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_PNG_H=1 -I.   -Wdate-time -D_FORTIFY_SOURCE=2  -Werror -c -o pngwrite.o pngwrite.c
@mikalstill
Copy link
Owner

Thanks for the contribution.

@mikalstill mikalstill merged commit 177e87f into mikalstill:master May 7, 2023
@LocutusOfBorg LocutusOfBorg deleted the patch-1 branch May 10, 2023 13:35
@LocutusOfBorg
Copy link
Contributor Author

thanks for merging!

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.

None yet

2 participants