squid
squid copied to clipboard
Maintenance: Better xgetaddrinfo() local variable declarations
updated; I've moved all declarations at the innermost useable scope and ensured proper initialization
Okay, I'd like to change course on this one: this code hasn't been built in a long time, and I would like to just remove it.
If we look at getaddrinfo.h:69 , where xgetaddrinfo is declared, it contains in its parameters a sctruct addrinfo *; which is never declared in a visible scope for that declaration.
Forcing the precompiler guards to ensure that code is built, results in:
In file included from ../compat/compat.h:87,
from ../include/squid.h:32,
from GnuRegex.c:39:
../compat/getaddrinfo.h:71:45: error: 'struct addrinfo' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
const struct addrinfo *hints, struct addrinfo **res);
^~~~~~~~
../compat/getaddrinfo.h:75:41: error: 'struct addrinfo' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
SQUIDCEXTERN void xfreeaddrinfo (struct addrinfo *ai);
^~~~~~~~
cc1: all warnings being treated as errors
So my proposal is to just remove this compat file, it's probably a relic from a long time ago when a proper Internet stack was not present in all OSes.
FWIW this code is/was for IPv6 support on native MinGW Windows builds. I do hope to get that environment building again so we can provide a modern Squid that does not require full Cygwin environment setup/install on Windows.
@kinkie, you requested my review. But with the latest iteration of this I am waiting on confirmation that the mingw builds no longer need this compat code.
IIRC squidclient.exe used to build despite issues in the other code - so it should be usable as a test binary for the necessary proof-of-need.
note to self: test build triggered at https://build.squid-cache.org/job/anybranch-mingw-cross/1/console
Merging a very stale branch messed it up. Closing it, and opening a new one about removing:
getaddrinfo, getnameinfo.h, inet_ntop.h, inet_pton.h, getnameinfo.c, inet_ntop.c, inet_pton.c
Closing it, and opening a new one
Before you open a new PR, please check that the outstanding change requests for this PR are addressed in the new PR branch.
BTW, you can always start from scratch in your workspace and then force-push your branch to the public PR branch. Force pushing should be avoided, but when the choice is between "closing one PR (with non-trivial review history) and opening a new one" and "force push", force pushing may be the lesser evil.