Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 3-2-1 and compatible types
#4
Please note that there is a definition of 'compatible type' in the glossary

Given the usual definitions of int32_t and int64_t, they cannot be the same size, so are never compatible.

Furthermore, for example, int and long are never compatible types, even on machines where they have the same size.
void foo(int x); and
void foo(long x); are always distinct overloads, even if int and long happen to be the same size
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)