Sujet : Re: New VSI post on Youtube
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 14. Aug 2024, 19:48:04
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <66bcfbe3$0$717$14726298@news.sunsite.dk>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
And it has different size of long and pointers. Causing problems
for two cases:
* code that make implicit assumptions that those are 32 bit
* mixing C and C++
I am getting more and more convinced that C and C++
code should completely switch to the explicit length
model.
So:
#include <stdint.h>
or:
#include <cstdint>
and use:
int8_t
int16_t
int32_t
int64_t
uint8_t
uint16_t
uint32_t
uint64_t
and consider putting:
#define int ">>>> DO NOT USE INT <<<<"
#define short ">>>> DO NOT USE SHORT <<<<"
#define long ">>>> DO NOT USE LONG <<<<"
in as well to enforce.
Where did I put that asbestos suit to protect me
from the C/C++ crowd?
:-)
Arne