You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enum DerivedDeclarator combines pointer, array, and function declarators. However, pointer declarators in C behave differently from array and function declarators. Pointer declarators are considered in right-to-left order, but array declarators go from left to right. For example:
int*const*volatilea[2][4];
This declares a as (array 2 of (array 4 of (volatile pointer to (const pointer to (int))))), but the DerivedDeclarators will be provided in the following order: Pointer(const), Pointer(volatile), Array(2), Array(4).
When using this list of DerivedDeclarators to build C types, special care should be taken to apply pointers in one direction and when they end, apply the rest in reverse direction. It would be more convenient to have RTL declarators and LTR declarators separated in the AST type system.
This is only my wish and suggestion and not a bug report. Please feel free to reject this issue as "won't do" if it goes against the philosophy of your crate.
The text was updated successfully, but these errors were encountered:
Enum
DerivedDeclarator
combines pointer, array, and function declarators. However, pointer declarators in C behave differently from array and function declarators. Pointer declarators are considered in right-to-left order, but array declarators go from left to right. For example:This declares a as (array 2 of (array 4 of (volatile pointer to (const pointer to (int))))), but the DerivedDeclarators will be provided in the following order:
Pointer(const), Pointer(volatile), Array(2), Array(4)
.When using this list of DerivedDeclarators to build C types, special care should be taken to apply pointers in one direction and when they end, apply the rest in reverse direction. It would be more convenient to have RTL declarators and LTR declarators separated in the AST type system.
This is only my wish and suggestion and not a bug report. Please feel free to reject this issue as "won't do" if it goes against the philosophy of your crate.
The text was updated successfully, but these errors were encountered: