Re: [PATCH v2 1/1] vreportf(): avoid relying on stdio buffering
- From
- Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
- Date
- Oct 29, 2019, 20:11 UTC
- Message-ID
- <97291857-42a2-4865-b265-d55fcf131ba5@syntevo.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1910292049530.46@tvgsbejvaqbjf.bet>
On 29.10.2019 20:57, Johannes Schindelin wrote:
Show 5 quoted lines
> It is not entirely obvious to me what exactly you mean by "this", > assuming that you refer to comparing two pointers via `<`, I agree that > this is not the best idea, I changed it to `off < pend - msg`. If my > assumption is correct, however, we are still talking about C, so I > wonder how this C++ document you linked could bear any relevance:
The linked portion of text speaks about adding to pointer. The paragraph is a bit long and my quote was indeed hard to grasp. And yes, sorry, C++ habits. However, the same thing applies to C, let's have this link instead:
https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
Hopefully a better quote this time (c/c++ standard are hard to read for mortals like me):
When an expression that has integer type is added to or subtracted from a pointer <...> If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, <...> otherwise, the behavior is undefined.
> Quite honestly, I purposefully refrained from copying that information.
That's a pity, I've put quite an effort into researching all that.