Re: [PATCH v2 1/1] vreportf(): avoid relying on stdio buffering

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

 



On 29.10.2019 20:57, Johannes Schindelin wrote:

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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux