| От | Neil Conway |
|---|---|
| Тема | Re: minor smgr code cleanup |
| Дата | |
| Msg-id | 87fzetoshv.fsf@mailbox.samurai.com обсуждение исходный текст |
| Ответ на | Re: minor smgr code cleanup (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-patches |
Tom Lane <tgl@sss.pgh.pa.us> writes: > This change is actually wrong (backwards), no? You want a true result > on equality. *sigh*, I'm an idiot. Thanks for catching my mistake! > Pretending that the result of strcmp is a bool is a type pun, and > one that can rise up to bite you. In the case at hand, strncmp is > allowed to return (say) 256 to indicate a nonzero result --- which > would be lost when the value is squeezed into a bool (char). See > the archives; we've had at least one bug of this ilk. Good point, and good to know. I just left the code as it previously was (but updated the comment), and applied the patch. Thanks again. -Neil
В списке pgsql-patches по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера