mirror of
https://github.com/hanzoai/postgres.git
synced 2026-10-30 18:33:07 +00:00
PG18's elog/ereport macro now plants `int __errno_location pg_attribute_unused()` in the local scope (pg_prevent_errno_in_scope, src/include/utils/elog.h) to catch accidental errno reads after error reporting clobbers it. This shadows glibc's __errno_location() function, so any direct strerror(errno) inside the elog argument list breaks with "called object __errno_location is not a function or function pointer". Fix: save errno into a stack int *before* elog, then strerror(saved_errno).