S
Sune
Hi all,
there are several situations where integer promotion is performed in C
and I need to confirm my understanding of it. Let's contain the
discussion to workstation/server CPUs of 32/64 bits, I'm afraid 8/16
bits CPUs may add details I'm not interested in. Hopefully someone
here can help out:
- As long as I use function prototypes there will be no argument
integer promotions (unless they are variadic)
- All data types of smaller size than int, will be promoted to int
before any arithmetics can be performed.
Please confirm/shoot down the above statements.
Next part, will I pay a performance penalty for these integer
promotions? I've read somewhere, sometime ago that I would, but I'm
not able to find any convincing evidence that's the case.
Thanks in advance
/Olle
there are several situations where integer promotion is performed in C
and I need to confirm my understanding of it. Let's contain the
discussion to workstation/server CPUs of 32/64 bits, I'm afraid 8/16
bits CPUs may add details I'm not interested in. Hopefully someone
here can help out:
- As long as I use function prototypes there will be no argument
integer promotions (unless they are variadic)
- All data types of smaller size than int, will be promoted to int
before any arithmetics can be performed.
Please confirm/shoot down the above statements.
Next part, will I pay a performance penalty for these integer
promotions? I've read somewhere, sometime ago that I would, but I'm
not able to find any convincing evidence that's the case.
Thanks in advance
/Olle