News for hackers. Stuff that matters.
Re:The perils of transition to 64-bit time_t by SkiFire13 on Saturday September 28, 2024 @01:55PM (#41681835)
Yeah, the problem in general with type aliases is that they're just that, aliases, not proper types. This means that they leak all the details of the underlying type, and don't work for proper encapsulation, which is what's needed for being able to change what should be implementation details.
Re:The perils of transition to 64-bit time_t by tsimionescu on Saturday September 28, 2024 @04:15PM (#41682679)
The problem here would be exactly the same regardless of what form this type took. The issue is fundamental to any low level language: the size of a type is a part of its public API (well, ABI), by definition. This is true in C++ with private fields as well, for example: if you add a private field to a class, or change the type of a private field with one of a different size, all code using that class has to be re-built. The only way to abstract this is to use types strictly through pointers, the way Java does.