Re: [HACKERS] proper format for printing GetLastError()

2011-07-06 Thread Peter Geoghegan
Yeah, I noticed that myself recently. On 6 July 2011 12:48, Magnus Hagander wrote: > Nope. I think it's only in there because of lazyness, in general. %lu > seems to be the correct choice. Yes, it's the correct choice. >> Thirdly, why are we not trying to print a textual message? > > I'd say t

Re: [HACKERS] proper format for printing GetLastError()

2011-07-06 Thread Magnus Hagander
On Mon, Jul 4, 2011 at 17:29, Peter Eisentraut wrote: > About half of our code prints GetLastError() using %d after casting it > to int (actually, about half of that half uses %i, another thing to sort > out, perhaps), and the other half uses %lu without casting.  I gather > from online documentat

[HACKERS] proper format for printing GetLastError()

2011-07-04 Thread Peter Eisentraut
About half of our code prints GetLastError() using %d after casting it to int (actually, about half of that half uses %i, another thing to sort out, perhaps), and the other half uses %lu without casting. I gather from online documentation that GetLastError() returns DWORD, which appears to be unsi