Re: Refactoring backend fork+exec code
| От | Tom Lane |
|---|---|
| Тема | Re: Refactoring backend fork+exec code |
| Дата | |
| Msg-id | 4119680.1710913067@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Refactoring backend fork+exec code (Heikki Linnakangas <hlinnaka@iki.fi>) |
| Ответы |
Re: Refactoring backend fork+exec code
|
| Список | pgsql-hackers |
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> Committed, with some final cosmetic cleanups. Thanks everyone!
A couple of buildfarm animals don't like these tests:
Assert(child_type >= 0 && child_type < lengthof(child_process_kinds));
for example
ayu | 2024-03-19 13:08:05 | launch_backend.c:211:39: warning: comparison of constant 16 with expression of
type'BackendType' (aka 'enum BackendType') is always true [-Wtautological-constant-out-of-range-compare]
ayu | 2024-03-19 13:08:05 | launch_backend.c:233:39: warning: comparison of constant 16 with expression of
type'BackendType' (aka 'enum BackendType') is always true [-Wtautological-constant-out-of-range-compare]
I'm not real sure why it's moaning about the "<" check but not the
">= 0" check, which ought to be equally tautological given the
assumption that the input is a valid member of the enum. But
in any case, exactly how much value do these assertions carry?
If you're intent on keeping them, perhaps casting child_type to
int here would suppress the warnings. But personally I think
I'd lose the Asserts.
regards, tom lane
В списке pgsql-hackers по дате отправления: