Re: Not-terribly-safe checks for CRC intrinsic support

2025-04-04 Thread Tom Lane
John Naylor writes: > On Sat, Mar 15, 2025 at 6:04 AM Tom Lane wrote: >> In short, I think we ought to apply and perhaps back-patch something >> like the attached. > Seems like reasonable defensive coding and consistency. Thanks for looking at it. > I'd be okay with keeping the original commen

Re: Not-terribly-safe checks for CRC intrinsic support

2025-03-17 Thread John Naylor
On Sat, Mar 15, 2025 at 6:04 AM Tom Lane wrote: > > In short, I think we ought to apply and perhaps back-patch something > like the attached. Seems like reasonable defensive coding and consistency. -/* return computed value, to prevent the above being optimized away */ +/* else this func

Re: Not-terribly-safe checks for CRC intrinsic support

2025-03-16 Thread Tom Lane
"David G. Johnston" writes: > On Sunday, March 16, 2025, Steven Niu wrote: >> +# is missing, we must link not just compile, and store the results in >> global > I’d probably add a comma before the “not” though. Or maybe: we must also > link and store the results in global A comma there wouldn'

Re: Not-terribly-safe checks for CRC intrinsic support

2025-03-16 Thread David G. Johnston
On Sunday, March 16, 2025, Steven Niu wrote: > > +# is missing, we must link not just compile, and store the results in > global > > The "compile" should be "compiler"? > No. Compile is the verb that pairs with link. Compiler is a noun, its compliment being the linker. I’d probably add a comm

Re: Not-terribly-safe checks for CRC intrinsic support

2025-03-16 Thread Tom Lane
Steven Niu writes: > +# is missing, we must link not just compile, and store the results in > global > The "compile" should be "compiler"? I think it's okay as-is: "link" and "compile" are both being used as verbs. We could say "run the compiler", but that's longer without being better. Besid

Re: Not-terribly-safe checks for CRC intrinsic support

2025-03-16 Thread Steven Niu
+# is missing, we must link not just compile, and store the results in global The "compile" should be "compiler"? Regards, Steven 在 2025/3/15 7:04, Tom Lane 写道: I noticed that our configuration-time checks for the presence of CRC intrinsics generally look like unsigned int crc = 0;