]> git.ipfire.org Git - thirdparty/squid.git/commit - src/fs_io.h
Bug 4843 pt3: GCC-8 fixes and refactoring (#172)
authorAmos Jeffries <yadij@users.noreply.github.com>
Wed, 4 Jul 2018 06:54:17 +0000 (06:54 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 4 Jul 2018 06:54:22 +0000 (06:54 +0000)
commitb56b37cfd68069691a047c51d50d13d05a23893a
tree8cbbfa71f4aba3d55f99c9653e475200716786e8
parent702a9bc36cbaf3782827e12dec905da705aab971
Bug 4843 pt3: GCC-8 fixes and refactoring (#172)

GCC-8 enables a lot more warnings related to unsafe coding
practices. The old Squid code contains a lot of risky buffer
size assumptions and implicit assumptions about C-string strcat,
strncat and snprintf  changes when operating on those buffers -
many can result in output truncation. Squid's use of -Werror
makes these many issues all go from warnings to outright
compile failures.

Rather than just extending the char* buffer sizes not to
truncate this work seeks to actually remove the issues
permanently by converting to SBuf and updated Squid coding
styles.

The C++1z compilers (GCC-8 and Clang 4.0) are beginning to warn
about C functions memset/memcpy/memmove being used on class
objects which lack "trivial copy" constructor or assignment
operator - their use is potentially unsafe where anything more
complex than trivial copy/blit is required. A number of classes
in Squid are safely copied or initialized with those functions
for now but again the -Werror makes these hard errors.
Completing affected objects conversion from C to C++ code avoids
any deeply hidden issues or adding compiler exceptions to
silence the warnings.

see individual commit messages for details on the particular
changes each does.
58 files changed:
src/CacheManager.h
src/HttpRequest.cc
src/MemObject.cc
src/MemObject.h
src/PeerDigest.h
src/SquidConfig.h
src/StatCounters.h
src/StatHist.h
src/acl/BoolOps.cc
src/anyp/TrafficMode.h
src/cache_cf.cc
src/client_side_reply.cc
src/clients/FtpGateway.cc
src/debug.cc
src/dlink.h
src/dns_internal.cc
src/esi/Element.h
src/esi/ElementList.h [deleted file]
src/esi/Esi.cc
src/esi/Makefile.am
src/esi/Sequence.cc
src/esi/Sequence.h
src/eui/Eui64.h
src/fqdncache.cc
src/fs/rock/RockRebuild.cc
src/fs/ufs/UFSSwapDir.cc
src/fs/ufs/UFSSwapDir.h
src/fs_io.cc
src/fs_io.h
src/htcp.cc
src/icmp/Icmp.h
src/icmp/IcmpPinger.cc
src/icmp/IcmpSquid.cc
src/icmp/net_db.cc
src/ident/Ident.cc
src/ipc/StoreMap.cc
src/ipc/StoreMap.h
src/ipc/TypedMsgHdr.cc
src/ipc/TypedMsgHdr.h
src/ipcache.cc
src/log/ModStdio.cc
src/neighbors.cc
src/peer_digest.cc
src/snmp/Pdu.cc
src/snmp/Pdu.h
src/snmp/Session.cc
src/snmp/Session.h
src/snmp/Var.cc
src/ssl/PeekingPeerConnector.cc
src/stat.cc
src/store/Disks.cc
src/store_digest.cc
src/store_rebuild.cc
src/store_rebuild.h
src/tests/stub_MemObject.cc
src/tests/stub_cache_manager.cc
src/tools.cc
src/tunnel.cc