From: Paul Eggert <eggert@cs.ucla.edu>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: Re: supporting strings > 2 GB
Date: Sun, 13 Oct 2019 13:12:20 -0700 [thread overview]
Message-ID: <b82b79f8-68f5-db92-6375-80b91d226f53@cs.ucla.edu> (raw)
In-Reply-To: <1779544.eJvvWEHBEu@omega>
On 10/13/19 12:50 PM, Bruno Haible wrote:
> The C or POSIX standards deal only with layer 1). However, layer 2) is
> essential for programs, to make the use of the new APIs easy.
Right, and I see the need for two layers. I'm still not seeing, though, the
exact division between the two layers in this instance.
With large file support, POSIX took an old function lseek that used 'long', and
said that lseek should use the new type 'off_t' instead. Old implementations
could simply add 'typedef long off_t;' and conform. There is no OFF_MAX or
PRIdOFF because off_t is not part of ISO C. Programs define _FILE_OFFSET_BITS to
choose which off_t they get.
A difference here is that we'd be proposing a change to ISO C (it could be done
only in POSIX, but it's really a change to the C standard). In ISO C there's a
tradition that types like 'ptrdiff_t' all have macros like PTRDIFF_MAX, PRIdPTR,
etc., and so presumably this tradition should apply to printf_len_t.
If we take this approach, there should be no need for %ln vs %n or %**d vs %*d;
programs that define _PRINTF_LARGE will get a wide printf_len_t and things will
"just work" if programs consistently use printf_len_t instead of int (and use
the related macros too).
prev parent reply other threads:[~2019-10-13 20:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-12 14:38 supporting strings > 2 GB Bruno Haible
2019-10-13 3:01 ` Paul Eggert
2019-10-13 17:38 ` Bruno Haible
2019-10-13 18:32 ` Paul Eggert
2019-10-13 19:50 ` Bruno Haible
2019-10-13 20:12 ` Paul Eggert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b82b79f8-68f5-db92-6375-80b91d226f53@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).