[Top][All Lists]

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

Re: [bug-inetutils] snprintf problem in rcp.c

From: Alain Magloire
Subject: Re: [bug-inetutils] snprintf problem in rcp.c
Date: Fri, 23 May 2003 14:11:29 -0400 (EDT)

> I was building inetutils-1.4.2 on an SGI IRIX 6.5.19m with both gcc 2.95.2
> and the mipspro compiler version and had a problem with the
> following code starting on line 560.
>  snprintf(buf, sizeof buf,
>              (sizeof(stb.st_size) > sizeof(long)
>               ? "C%04o %qd %s\n"
>               : "C%04o %ld %s\n"),
>              stb.st_mode & RCP_MODEMASK, stb.st_size, last);
> The problem is with the %qd format specifier. This is not supported on the
> irix machine. It can sucessfully be replaced with %lld.

Yes, you are right, %qd was the old BSD way of doing quad_t or long long.
We should probably move along to C99 features.  Problem is that lots of
"old" platforms support %qd but not %lld  and it will kill me to go
in around of #ifdef and autoconf macros for testing this feature 8-).

Any comments ?
Should we move to %lld or whateve c99 say and remove %qd ?
That would also mean updating the inetutils/lib/snprintf.c


reply via email to

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