Re: gcc -Wclobbered in PostgresMain
Sergey Shinderuk <s.shinderuk@postgrespro.ru>
From: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-07-10T09:39:52Z
Lists: pgsql-hackers
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 > send_ready_for_query, but perhaps we shouldn't? I don't know. Maybe marking them volatile is more future proof. Not sure. >> I also moved firstchar's declaration inside the loop where it's used, to >> make it clear that this variable needn't be volatile and is not >> preserved after longjmp(). > > Good idea, but then why not the same for input_message? It's fully > reinitialized each time through the loop, too. Yeah, that's better. > In short, something like the attached, except I'm not totally sold > on changing the volatility of the timeout flags. Looks good to me. Thank you. -- Sergey Shinderuk https://postgrespro.com/
Commits
-
Be more rigorous about local variables in PostgresMain().
- a8b7424684b3 17.0 landed
- 93dcdfa88f5f 16.0 landed
- 6b51fe8340bb 13.12 landed
- 671bf1cf27cf 11.21 landed
- 48582cf9ed96 14.9 landed
- 22447db17cc0 15.4 landed
- 0c32818d7559 12.16 landed