[commit] Order parameters "rw", not "wr"
Andrew Cagney
ac131313@redhat.com
Thu Nov 13 17:46:00 GMT 2003
> On Thu, Nov 13, 2003 at 11:35:56AM -0500, Andrew Cagney wrote:
>
>>
>
>> >>O_RDWR Open for reading and writing
>> >>S_IRWXU 00700 user (file owner) has read, write and execute permission
>> >>drwxr-xr-x 2 cagney cagney 8192 Nov 11 13:52 bin
>
>> >
>> >
>> >Those aren't arguments, just a couple occurances of "read, write", so I
>> >fail to see the connection. Consider memcpy, strcat, fgets, sprintf.
>
>>
>> What you list here have little if any relevance to the interfaces in
>> question.
>
>
> There are, as far as I know, no examples of functions in the standard
> library which take an output buffer last. As much of a C convention as
> there is suggests they belong at the beginning.
>
> If you're going to ignore that very weak precedent, that's your
> perogative, go right ahead. But please don't claim that "O_RDWR" is in
> any way relevant to the argument ordering on target_xfer_partial
> either.
The xfer functions in question take _three_ [relevant] parameters:
- an object
- a read param
- a write param
while the examples you cite take only _two_ [relevant] parameters:
- an object
- a read XOR write param
where, in the second case, the parameters are ordered randomly vis:
- write/read, object first (strcat, sprintf, write):
- the write object
- a read param
- read/write, object first (write):
- the read object
- a write param
- read/write, object last (fwrite):
- a read param
- the write object
- write/read, object last (fgets)
- a write param
- the read object
Consequently, as I've repeatedly stated, I see no relevance.
Andrew
More information about the Gdb-patches
mailing list