Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.2.8 - why aren't aliases allowed?
#2
The aim of the rule is to make the intent of the cast clear.

If aliases were allowed, as std::uintptr_t is itself an alias to some other type T, this would mean that any cast to T (or other alias of T) would also have to be allowed. You have lost the clarity that you are intentionally casting a pointer to a 'big enough' integer.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: Rule 8.2.8 - why aren't aliases allowed? - by misra cpp - 28-03-2025, 01:05 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)