| От | Tom Lane |
|---|---|
| Тема | Re: 32-bit ints on 64-bit linux |
| Дата | |
| Msg-id | 1274.1111434389@sss.pgh.pa.us обсуждение |
| Ответ на | Re: 32-bit ints on 64-bit linux (Kelly Burkhart <kelly@tradebotsystems.com>) |
| Список | pgsql-odbc |
Kelly Burkhart <kelly@tradebotsystems.com> writes:
> Can anyone with a better understanding of the libc standard comment on
> the "correctness" of the following lines?
> int8_t i1;
> int16_t i2;
> printf("%d", i1);
> printf("%d", i2);
That's perfectly correct, unless int is narrower than 16 bits on your
platform ;-). Anything narrower than int is implicitly coerced to int
when it's passed to printf. The existence of the h modifier in the
printf format syntax is for scanf, not printf; scanf does have to
know the difference between int and narrower-than-int variables.
regards, tom lane
В списке pgsql-odbc по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера