On Wed, Jul 12, 2017 at 07:19:06AM +0200, Gisle Vanem wrote: > Thomas Dickey wrote: > > >The current version of lynx is 2.8.8 > > > >It's available at > > http://lynx.invisible-island.net/ > > ftp://invisible-island.net/lynx/ > > When using clang-cl to build this version, I got this > error:
I've been using "clang" (along with other compilers of course), hadn't noticed https://clang.llvm.org/docs/UsersManual.html#clang-cl > WWW/Library/Implementation/HTFTP.c(3968,40): error: expected ')' > if (sscanf(response_text, "%d %" SCN_off_t, &code, > &size) > ^ > WWW/Library/Implementation/HTFTP.c(3968,17): note: to match this '(' > if (sscanf(response_text, "%d %" SCN_off_t, &code, > &size) > ^ That's the second (recent) problem reported with the scanf-format. Just in case I got caught by a gcc-ism, I checked http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html but don't see a clue that it's a recent addition to C. (On Windows, I'm still using Visual Studio 2008 - have 2012 and 2015 on other machines, but haven't gotten around to building the libraries, etc., to investigate lynx with that...) > SCN_off_t should be "I64d" in my build, but not sure how > to tweak that into effect (seems <inttypes.h> is not included). > For now, I just put that in my generated lynx_cfg.h. hmm - if it's generated (and the page indicates clang-cl is Windows) how is it generated? > Also, in HTTCP.c / really_getaddrinfo(), it seems the > free(res); > > should be outside the > if (error || !res) { but it is outside that. The code reads error = getaddrinfo(host, port, &hints, &res); if (error || !res) { CTRACE((tfp, "HTGetAddrInfo: getaddrinfo(%s, %s): %s\n", host, port, gai_strerror(error))); } else { and the free is past the end of the else. If it's null, that's (according to the nearly-30-year-old standard) okay. > > block (otherwise a crash could happen in 'free(res)'). > BTW, the code-style and use of tabs makes this difficult > to read. there are too many ifdefs - I hide some with macros, but still... (the format itself is using "lnx-indent" from my cindent package). > And in HTTP.c / ws_netread(), the: > InitializeCriticalSection(&critSec_READ); > > shouldn't this be: > EnterCriticalSection(&critSec_READ); possibly (it's very old code...) > Several other warnings from clang-cl. Please try it. > It's an awesome compiler. > > -- > --gv > > _______________________________________________ > Lynx-dev mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/lynx-dev -- Thomas E. Dickey <[email protected]> http://invisible-island.net ftp://invisible-island.net
signature.asc
Description: Digital signature
_______________________________________________ Lynx-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lynx-dev
