This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/commit] wrong type in call to _open_osfhandle


Hello,

I noticed this when compiling this file on 64bit Windows.
The _open_osfhandle function is documented as having the following
profile:

    int _open_osfhandle (
       intptr_t osfhandle,
       int flags 
    );

However, we currently call this function as follow:

    scb->fd = _open_osfhandle ((long) h, O_RDWR);

The cast to long is causing trouble, because on x86_64-windows,
long is still 32bit, whereas intptr_t is 64bit. Fixed thusly:

2009-01-07  Joel Brobecker  <brobecker@adacore.com>

	* ser-mingw.c (ser_windows_open): Use proper type when casting
	in call to _open_osfhandle.

Tested on x86-windows and x86_64-windows, but only using AdaCore's
testsuite.  I don't think this part is very risky, and I plan to commit
this in a few days unless there are some objections.

-- 
Joel

Attachment: open_osfhandle.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]