Artifacts Associated With Ticket 3599194fffffffffffffffffffffffffffffffff
Ticket change [327e61d66a] (rid 93622) by afredd on 2013-01-02 10:44:01:
- assignee initialized to: "mdejong"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The function freeaddrinfo() in fake-rfc2553.c should be called fake_freeaddrinfo() since the header file fake-rfc2553.h has: #ifndef HAVE_FREEADDRINFO #define freeaddrinfo(a) (fake_freeaddrinfo(a)) void freeaddrinfo(struct addrinfo *); #endif /* !HAVE_FREEADDRINFO */ When compiled it fails to find a definition for fake_freeaddrinfo! Here is a patch diff to fix this and a couple of other issues the compiler found. diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c index 666144f..3bb2834 100644 --- a/compat/fake-rfc2553.c +++ b/compat/fake-rfc2553.c @@ -84,7 +84,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, if (host != NULL) { if (flags & NI_NUMERICHOST) { - int len; + size_t len; Tcl_MutexLock(&netdbMutex); len = strlcpy(host, inet_ntoa(sin->sin_addr), hostlen); Tcl_MutexUnlock(&netdbMutex); @@ -135,7 +135,7 @@ fake_gai_strerror(int err) #ifndef HAVE_FREEADDRINFO void -freeaddrinfo(struct addrinfo *ai) +fake_freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; @@ -199,7 +199,7 @@ fake_getaddrinfo(const char *hostname, const char *servname, port = strtol(servname, &cp, 10); if (port > 0 && port <= 65535 && *cp == '\0') - port = htons(port); + port = htons((unsigned short) port); else if ((sp = getservbyname(servname, NULL)) != NULL) port = sp->s_port; else - foundin initialized to: "current: 8.6.0"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "afredd"
- subsystem initialized to: "52. Portability Support"
- title initialized to: "compat/fake-rfc2553.c is broken"
- type initialized to: "Bug"
Ticket change [4d29956cf9] (rid 127015) by nijtmans on 2013-01-02 18:07:56:
- assignee changed to: "rmax"
Ticket change [435b46d01d] (rid 116544) by rmax on 2013-01-02 18:15:56:
- icomment:
Thanks for your report, I'll have a look at it. Just out of curiosity: What platform building Tcl on that needs this fake-rfc2553 stuff?
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [46111062a3] (rid 99452) by afredd on 2013-01-02 20:14:11:
- icomment:
> >Comment By: Reinhard Max (rmax) > Date: 2013-01-02 03:15 > > Message: > Thanks for your report, I'll have a look at it. > Just out of curiosity: What platform building Tcl on that needs this > fake-rfc2553 stuff? > It's a 'unix' build option driven by the configured symbol NEED_FAKE_RFC2553. In tclUnixPort.h there's: #ifdef NEED_FAKE_RFC2553 # include "../compat/fake-rfc2553.h" #endif However, i'm on a 32 bit Win XP machine :-) Had to make a number of, er, hacks to make a git blead copy of Tcl to build which included using the fake-rfc2553 stuff. And yes i know this is not the Right Thing To Do. But i can at least now play around with the code. (8.5 used to build just fine on this machine without any hacks). Not sure who _really_ needs this. The only way i can see how this ever could have worked is if HAVE_FREEADDRINFO was also defined. Then the (fake_)?freeaddrinfo() would not have been compiled in. One more thing: the (unsigned short) cast in the call to htons() should really be a (uint16_t) cast; however, then you should really add a #include of <stdint.h> and i didn't want to further muddy the waters.
- login: "afredd"
- mimetype: "text/plain"
- username: "afredd"
- icomment:
Ticket change [84e5e8ab06] (rid 117641) by nijtmans on 2013-02-24 03:01:58:
- closedate changed to: "2013-02-23T20:01:58"
- closer changed to: "nijtmans"
- icomment:
To me afredd's remarks all look valid. So, committed to trunk now. Please confirm that everything is OK now.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "nijtmans"
Ticket change [bc3d5c5bcf] (rid 134170) by dkf on 2013-09-24 12:00:08:
- assignee changed to: "aku"
- closedate changed to: "2456560.00009796"
- closer changed to: "dkf"
- comment changed to:
The function freeaddrinfo() in fake-rfc2553.c should be called fake_freeaddrinfo() since the header file fake-rfc2553.h has: #ifndef HAVE_FREEADDRINFO #define freeaddrinfo(a) (fake_freeaddrinfo(a)) void freeaddrinfo(struct addrinfo *); #endif /* !HAVE_FREEADDRINFO */ When compiled it fails to find a definition for fake_freeaddrinfo! Here is a patch diff to fix this and a couple of other issues the compiler found. diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c index 666144f..3bb2834 100644 --- a/compat/fake-rfc2553.c +++ b/compat/fake-rfc2553.c @@ -84,7 +84,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, if (host != NULL) { if (flags & NI_NUMERICHOST) { - int len; + size_t len; Tcl_MutexLock(&netdbMutex); len = strlcpy(host, inet_ntoa(sin->sin_addr), hostlen); Tcl_MutexUnlock(&netdbMutex); @@ -135,7 +135,7 @@ fake_gai_strerror(int err) #ifndef HAVE_FREEADDRINFO void -freeaddrinfo(struct addrinfo *ai) +fake_freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; @@ -199,7 +199,7 @@ fake_getaddrinfo(const char *hostname, const char *servname, port = strtol(servname, &cp, 10); if (port > 0 && port <= 65535 && *cp == '\0') - port = htons(port); + port = htons((unsigned short) port); else if ((sp = getservbyname(servname, NULL)) != NULL) port = sp->s_port; else - login: "dkf"
- mimetype: "text/plain"
- severity changed to: "Minor"
- status changed to: "Closed"