zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Change handrolled strftime to strftime in zftp.c
Date: Mon, 25 Mar 2019 21:13:27 +0900	[thread overview]
Message-ID: <A7DCA44C-CF98-4A56-8B82-ECAF78337F51@kba.biglobe.ne.jp> (raw)
In-Reply-To: <20190323101135.14344-2-wesley@mintlab.nl>


> 2019/03/23 19:11, Wesley Schwengle <wesleyschwengle@gmail.com> wrote:
> 
> +	    strftime(tmbuf, 15, "%Y%m%d%H%M%S", tm);

zsh has its own ztrftime() (which works on systems without strftime())
and we can use it here.

I tried it and of course it worked, but I noticed another (unrelated)
problem. If I build zsh with --enable-zsh-debug, and test on my Mac,

% zmodload zsh/zftp
% zftp local flame
 zftp.c:2519: Shell compiled with wrong off_t size

On Darwin (and 64 bit Linux) both long and off_t are 64 bit. In
configure.ac, line 975 and below, it says OFF_T_IS_64_BIT is
defined only if LONG_IS_64_BIT is NOT defined (i.e., long is 32 bit)
and off_t is 64 bit. But in zftp.c, line 2518 (before patch),


#ifdef OFF_T_IS_64_BIT
        printf("%s %s\n", output64(sz), mt);
#else
        DPUTS(sizeof(sz) > 4, "Shell compiled with wrong off_t size");
        printf("%ld %s\n", (long)sz, mt);
#endif


Should we replace "#ifdef OFF_T_IS_64_BIT" by "#ifndef OFF_T_IS_64_BIT"?

  reply	other threads:[~2019-03-25 12:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 10:11 [PATCH 0/1] Fix -Wformat-overflow= warnings " Wesley Schwengle
2019-03-23 10:11 ` [PATCH] Change handrolled strftime to strftime " Wesley Schwengle
2019-03-25 12:13   ` Jun T [this message]
2019-03-25 12:42     ` Peter Stephenson
2019-03-25 13:07       ` Jun T.
2019-03-25 13:32         ` Jun T.
2019-03-25 14:36         ` Peter Stephenson
2019-03-25 15:06           ` Jun T.
2019-03-25 15:08           ` Peter Stephenson

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A7DCA44C-CF98-4A56-8B82-ECAF78337F51@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).