I wrote: > It looks like that compiler adheres to the C89 restriction that an > initializer for an array or struct must contain only link-time-constant > expressions, even if the target object is of dynamic scope. > The macro works with a link-time-constant pointer argument, but not > with one that must be evaluated at runtime.
It strikes me that that means you could stick with this initialization method if you made the macro argument be a literal constant string name, like "buffer spinlock", and printed that rather than the address in s_lock_stuck. This would be different from what we do now, but not necessarily any less useful. I'm pretty dubious of the usefulness of the addresses you're printing right now, because most of them are indeed not the spinlock itself. regards, tom lane -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers