-
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
Rationale for allowing 0-width type bit<0>
?
#1252
Comments
For exeample
|
Thanks, Mihai, for the example. Are you intending that as an example of something you have found useful to include in a P4 program before? Or is it more along the lines of: "I (Mihai) would guess that someone might find code like this useful?" |
I think the point is that you might write a program with a macro that gets filled in according to a profile or configuration. If the value of the macro determines the width of a bitstring, and can assume the value |
Thanks for the explanations. That makes sense: widths of zero might be the outcome of some profile, not so much a goal as much as a consequence. |
Do we keep this open? Or has it converged? |
I think the issue has served its purpose of asking and answering the question. I will close it now. |
I know I was there in the P4 language design work group meetings where this was discussed. I had no objections at the time, and I still don't actually have any objections. I do have a few questions, though:
bit<0>
in a P4 program for something? If yes, what for?I am not sure, but my guess is that the primary reason for making a change to the spec to allow type
bit<0>
was along the lines of: well, we support structs and header type with no member fields, and tuples with 0 members, why not typebit<0>
, also?One of my reasons for asking is in thinking about whether it is considered important to make changes to the P4Runtime API specification to allow values of type
bit<0>
in control plane API messages, or whether to simply say "that type is not supported in the P4Runtime API": p4lang/p4runtime#428The text was updated successfully, but these errors were encountered: