[Top][All Lists]

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

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

From: Todd Vollmer
Subject: RE: [bug-inetutils] snprintf problem in rcp.c
Date: Fri, 23 May 2003 13:45:11 -0600

In regards to old platforms would not a compiler upgrade solve the problem (probably cause others). Pure speculation on my part but the 2.95.2 compiler I referenced below is close to 4 years old. I don't imagine most people use compilers much older than that if they can avoid it. I am not sure how 32 bit systems deal with the long long issue (struct?)

The original reason I was poking around the source code might interest you. We have a system that makes multiple concurrent requests vi rcp for files on a single raid system. It proves to be more efficient to adjust the block size higher on the reads. A block size is an optional argument on a cp command but not rcp. In addition I built a 64 bit version and had to change ftruncate to ftruncate64. We regularly deal with file sizes larger that 2GB.

Thanks for your time,
        Todd V.

-----Original Message-----
From: Alain Magloire [mailto:address@hidden]
Sent: Friday, May 23, 2003 12:11 PM
To: address@hidden
Cc: address@hidden
Subject: Re: [bug-inetutils] snprintf problem in rcp.c

> 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]