pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wip/squid4 compilation error



On Fri, Apr 26, 2019 at 09:39:19AM +0100, Mike Pumford wrote:
> I'd agree that's just wrong. The %ld is correct for long int regardless of
> long size and should work on any ANSI compliant compiler. It should be
> harmless on NetBSD to ignore the warning as sizeof int is the same on 32bit
> platforms as sizeof long but it doesn't make the code any less ugly and
> incorrect. :(

A similar one (i.e. not occurring on amd64):

ufs/RebuildState.cc:356:1: error: '%s' directive output may be truncated
writing up to 511 bytes into a region of size between 256 and 5
11 [-Werror=format-truncation=]
 Fs::Ufs::RebuildState::getNextFile(sfileno * filn_p, int *)
 ^~
ufs/RebuildState.cc:428:21: note: 'snprintf' output between 2 and 768
bytes into a destination of size 512
             snprintf(fullfilename, sizeof(fullfilename), "%s/%s",
             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      fullpath, entry->d_name);
                      ~~~~~~~~~~~~~~~~~~~~~~~~
At present have just increased the size of the concerned variable. But
sharing to seek better patch ideas.

Mayuresh



Home | Main Index | Thread Index | Old Index