Bug#1065756: pngnq: FTBFS on arm{el, hf}: rwpng.c:242:13: error: implicit declaration of function ‘strncmp’ [-Werror=implicit-function-declaration]

xiao sheng wen (=?UTF-8?Q?=E8=82=96=E7=9B=9B=E6=96=87?=) atzlinux at sina.com
Sun Mar 10 02:50:08 GMT 2024


Hi,

     I fix this bug in mentors:

https://mentors.debian.net/package/pngnq/

Welcome to review and upload.

[-Werror=implicit-function-declaration] is  promote to error level in 
arm{el, hf} arch than before.

Thanks!

在 2024/3/10 08:36, xiao sheng wen(肖盛文) 写道:
> Hi,
>
>     Thanks for your report.
> The upstream of this package almost dead.
>
> The patch is welcome.
>
> CC to debian-arm list.
>
> 在 2024/3/10 04:07, Sebastian Ramacher via Pkg-phototools-devel 写道:
>> Source: pngnq
>> Version: 1.1+ds-2
>> Severity: serious
>> Tags: ftbfs sid trixie
>> Justification: fails to build from source (but built successfully in 
>> the past)
>> X-Debbugs-Cc: sramacher at debian.org
>>
>> https://buildd.debian.org/status/fetch.php?pkg=pngnq&arch=armhf&ver=1.1%2Bds-2%2Bb1&stamp=1709981044&raw=0 
>>
>>
>> gcc -DHAVE_CONFIG_H -I.   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
>> -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 `libpng-config 
>> --I_opts` -Wall --pedantic -std=gnu99 -g -O2 
>> -Werror=implicit-function-declaration 
>> -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong 
>> -fstack-clash-protection -Wformat -Werror=format-security -c -o 
>> colorspace.o colorspace.c
>> rwpng.c: In function ‘rwpng_read_image’:
>> rwpng.c:242:13: error: implicit declaration of function ‘strncmp’ 
>> [-Werror=implicit-function-declaration]
>>    242 |         if(!strncmp("author",comments[c].key,6)){
>>        |             ^~~~~~~
>> rwpng.c:40:1: note: include ‘<string.h>’ or provide a declaration of 
>> ‘strncmp’
>>     39 | #include "rwpng.h"      /* typedefs, common macros, public 
>> prototypes */
>>    +++ |+#include <string.h>
>>     40 |
>> rwpng.c:242:46: warning: ‘strncmp’ argument 3 type is ‘int’ where 
>> ‘unsigned int’ is expected in a call to built-in function declared 
>> without prototype [-Wbuiltin-declaration-mismatch]
>>    242 |         if(!strncmp("author",comments[c].key,6)){
>>        |                                              ^
>> <built-in>: note: built-in ‘strncmp’ declared here
>> In file included from colorspace.c:7:
>> colorspace.h:25:18: warning: ‘d00’ defined but not used 
>> [-Wunused-variable]
>>     25 | static color_XYZ d00 = {0.0, 0.0, 0.0};
>>        |                  ^~~
>> rwpng.c:85:5: warning: ignoring return value of ‘fread’ declared with 
>> attribute ‘warn_unused_result’ [-Wunused-result]
>>     85 |     fread(sig, 1, 8, infile);
>>        |     ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from pngnq.c:99:
>> neuquant32.h:59:22: warning: ‘biasvalue’ declared ‘static’ but never 
>> defined [-Wunused-function]
>>     59 | static inline double biasvalue(unsigned int temp);
>>        |                      ^~~~~~~~~
>> pngcomp.c: In function ‘main’:
>> pngcomp.c:118:10: warning: variable ‘block_err_image’ set but not 
>> used [-Wunused-but-set-variable]
>>    118 |   float* block_err_image = NULL;
>>        |          ^~~~~~~~~~~~~~~
>> pngcomp.c:108:7: warning: variable ‘verbose’ set but not used 
>> [-Wunused-but-set-variable]
>>    108 |   int verbose = 0;
>>        |       ^~~~~~~
>> pngcomp.c: In function ‘printstats’:
>> pngcomp.c:506:30: warning: format ‘%ld’ expects argument of type 
>> ‘long int’, but argument 2 has type ‘png_uint_32’ {aka ‘unsigned 
>> int’} [-Wformat=]
>>    506 |   printf("Image Dimensions %ld x %ld 
>> \n",image1_info.width,image1_info.height);
>>        |                            ~~^ ~~~~~~~~~~~~~~~~~
>>        |                              |                      |
>>        |                              long int png_uint_32 {aka 
>> unsigned int}
>>        |                            %d
>> pngcomp.c:506:36: warning: format ‘%ld’ expects argument of type 
>> ‘long int’, but argument 3 has type ‘png_uint_32’ {aka ‘unsigned 
>> int’} [-Wformat=]
>>    506 |   printf("Image Dimensions %ld x %ld 
>> \n",image1_info.width,image1_info.height);
>>        | ~~^                       ~~~~~~~~~~~~~~~~~~
>>        | |                                  |
>>        |                                    long 
>> int                           png_uint_32 {aka unsigned int}
>>        |                                  %d
>> In file included from pngcomp.c:59:
>> colorspace.h: At top level:
>> colorspace.h:25:18: warning: ‘d00’ defined but not used 
>> [-Wunused-variable]
>>     25 | static color_XYZ d00 = {0.0, 0.0, 0.0};
>>        |                  ^~~
>> colorspace.h:24:18: warning: ‘d65’ defined but not used 
>> [-Wunused-variable]
>>     24 | static color_XYZ d65 = {0.94810,1.0000,1.07305};
>>        |                  ^~~
>> pngnq.c: In function ‘createoutname’:
>> pngnq.c:279:7: warning: ‘__builtin_strncpy’ output truncated before 
>> terminating nul copying 1 byte from a string of the same length 
>> [-Wstringop-truncation]
>>    279 |       strncpy(newdir+dir_len,DIR_SEPARATOR_STR,1);
>>        |       ^
>> cc1: some warnings being treated as errors
>> make[3]: *** [Makefile:403: rwpng.o] Error 1
>>
>> Cheers
> Regards,
>

-- 
肖盛文 xiao sheng wen
https://www.atzlinux.com 《铜豌豆 Linux》基于 Debian 的 Linux 中文 桌面 操作系统
Debian QA page: https://qa.debian.org/developer.php?login=atzlinux%40sina.com
Debian salsa: https://salsa.debian.org/atzlinux-guest
GnuPG Public Key: 0x00186602339240CB

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-phototools-devel/attachments/20240310/9d92d3f5/attachment.sig>


More information about the Pkg-phototools-devel mailing list