Re: gcc -Wclobbered in PostgresMain

2023-07-10 Thread Tom Lane
Sergey Shinderuk writes: > On 08.07.2023 18:11, Tom Lane wrote: >> Having done that, it wouldn't really be necessary to mark these >> as volatile. I kept that marking anyway for consistency with >> send_ready_for_query, but perhaps we shouldn't? > I don't know. Maybe marking them volatile is mor

Re: gcc -Wclobbered in PostgresMain

2023-07-10 Thread Sergey Shinderuk
Hello, Tom, On 08.07.2023 18:11, Tom Lane wrote: What we ought to be doing is resetting these two flags after the disable_all_timeouts call. Oops, I missed that. Having done that, it wouldn't really be necessary to mark these as volatile. I kept that marking anyway for consistency with s

Re: gcc -Wclobbered in PostgresMain

2023-07-08 Thread Tom Lane
Sergey Shinderuk writes: > While analyzing -Wclobbered warnings from gcc we found a true one in > PostgresMain(): > ... > These variables must be declared volatile, because they are read after > longjmp(). send_ready_for_query declared there is volatile. Yeah, you're on to something there. > W

gcc -Wclobbered in PostgresMain

2023-07-07 Thread Sergey Shinderuk
Hi, hackers! While analyzing -Wclobbered warnings from gcc we found a true one in PostgresMain(): postgres.c: In function ‘PostgresMain’: postgres.c:4118:25: warning: variable ‘idle_in_transaction_timeout_enabled’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] 4118 | bool