-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reason for limiting fixed-length types to have a constant width #1228
Comments
@pataei -- compile-time-known expressions are supported as type widths as long as you enclose them in parentheses. See Section 7.1.6.2 in the spec. |
it should be a compile-time known value in the spec. |
To double check my understanding, as an example, so there isn't anywhere in P4 that allows only |
These two should be fully equivalent and can be used in the same contexts. See also #1213 |
Closing this after the merge. |
I'm wondering why P4 spec forces
bit<W>
orint<W>
in some places, such as when they're used as the underlying type of a serializable enum or as the element type of a header. Why doesn't it just require a compile-time-known expression instead of a constant?Also, does the use of
W
in spec always indicate a constant?The text was updated successfully, but these errors were encountered: