bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Wget 1.12 v. VMS


From: Micah Cowan
Subject: Re: [Bug-wget] Wget 1.12 v. VMS
Date: Fri, 09 Oct 2009 00:54:48 -0700
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven M. Schweda wrote:
>>>    And, speaking of build-related info, would it be useful on other
>>> system types to include an indicator of large-file support somewhere in
>>> this stuff?  (Or has large-file support become so common that no one
>>> else worries about it now?)  A "sizeof off_t" test would be good enough
>>> for me.
>> It can't hurt.
> 
>    You say that now.

<snip>

>    At the moment, what I have looks like this:
> 
> [...]
> extern const char *compiled_features[];  /* I fixed only this one. */
> [...]
>   int i;
>                 /* Changes begin. */
>   int j;
>   int line_length;
>   const char *runtime_features[] = { "/", NULL, NULL };
>   const char **features[] = { compiled_features, runtime_features, NULL };
> 
>   /* Fill runtime_features[].  Be sure to leave an array-terminating NULL. */
>   if (sizeof (off_t) >= 8)
>     runtime_features[1] = "+large-file";
>   else
>     runtime_features[1] = "-large-file";
> 
>   printf (_("GNU Wget %s built on %s.\n\n"), version_string, OS_TYPE);
>   /* compiled_features is a char*[]. We limit the characters per
>      line to MAX_CHARS_PER_LINE and prefix each line with a constant
>      number of spaces for proper alignment. */
>   printf (_("Compile-time/Run-time features:\n"));
>   line_length = MAX_CHARS_PER_LINE - TABULATION;
>   printf ("%*c", TABULATION, ' ');
>   for (j = 0; features[j] != NULL; )
>     {
>       for (i = 0; features[j][i] != NULL; )
>         {
>           int len = strlen (features[j][i]) + 1;
>           line_length -= len;
>           if (line_length < 0)
>             {
>               printf ("\n%*c", TABULATION, ' ');
>               line_length = MAX_CHARS_PER_LINE - TABULATION - len;
>             }
>           printf ("%s ", features[j][i]);
>           i++;
>         }
>       j++;
>     }
>   printf ("\n");
> 
> 
> Here, the result looks like this:
> 
> ALP $ wgxl --version
> GNU Wget 1.12 built on VMS Alpha V7.3-2.
> 
> Compile-time/Run-time features:
>     +digest +ipv6 -nls +ntlm +opie +md5/builtin +https -gnutls +openssl
>     -iri / +large-file
> Wgetrc:
>     SYS$LOGIN:.wgetrc (user)
> 
> Copyright (C) 2009 Free Software Foundation, Inc.
> [...]
> 
>    I haven't checked it for portability problems (what could go wrong?)
> but I claim that this code actually does limit the line length properly
> (although I didn't trim that trailing space), and it really is indented,
> as the comment suggests.  It was so easy to toss in that "/" separator
> between the two classes of items, that I couldn't resist, but it's easy
> to remove, if desired.  Lots of formatting changes could be made, of
> course.  And the new array could be relegated to some other backwater,
> like "src/build_info.c", or some new module.

So, what I don't understand is, why is this a runtime check? I mean,
it's a build-time constant, isn't it? So I'm not clear on how that makes
it any different from the other things that are already in
compiled_features. Except that it's probably the only one so far that
wouldn't normally be configurable in the "configure" script.

Given that, I think I'll opt just to throw it in with the rest of the
stuff in build_info.c.in.

It looks like the configure script already does a check of off_t's size,
and defines SIZEOF_OFF_T accordingly. Not sure why that's particularly
helpful, given that sizeof(off_t) should be about as handy, and
available to the preprocessor... well, I suppose it avoids forcing you
to include appropriate headers to define off_t, just in order to get its
size. I need to make some changes to build_info.pl in order to support
non-definedness checks, though.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
Maintainer of GNU Wget and GNU Teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrO7EgACgkQ7M8hyUobTrFSTQCeNg+ePWANfGcJR7ArHgiWPQyb
xiQAnRGnFZLspy8lkq0tBasgZLyTzfOp
=TUuG
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]