OpenSSH warnings on FreeBSD

Darren Tucker dtucker at
Wed Dec 5 11:19:04 EST 2012

On Wed, Dec 5, 2012 at 6:00 AM, Eitan Adler <lists at> wrote:
> On 4 December 2012 13:51, Arthur Mesh <amesh at> wrote:
>> On Tue, Dec 04, 2012 at 04:05:51PM +0400, Loganaden Velvindron wrote:
>>> on FreeBSD, gcc complains that %d is used for sig_atomic_t
>>> Casting to (int) as a solution ?
>> I think casting to intmax_t is a safer approach, together with changing
>> the format to %jd (although I am not sure how portable this is).

Not everything has an intmax_t, and it's not used anywhere else in
OpenSSH so in order to use it we'd need to add it to configure.

> I think this is the more portable approach among the two.

%jd isn't portable either (it's not in SuSv2, for example):

Signal numbers have to fit into 7 bits (since they can be crammed into
the shell's return code with the high bit set) so casting to int
should be fine.

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

More information about the openssh-unix-dev mailing list