This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Re: [PATCH] support: Add TEST_COMPARE macro


On 11/27/2017 10:43 AM, Florian Weimer wrote:
I don't understand.

It is perfectly reasonable to warn for

   ch == EOF

(with ch of type char)

Sure, but that's a different topic. I was writing about the topic at hand, which is that C integer comparison sometimes disagrees with mathematical comparison. When ch is of type char, (ch == EOF) always returns the mathematically-correct answer on glibc platforms. None of the proposed TEST_COMPARE patches would catch the char-vs-EOF problem, because they're not designed to catch it: they're designed to catch the C-vs-mathematical comparison problem.


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