Skip to content
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

Changes for language spec update? Clarified restrictions for parameters with default values"? #449

Open
jafingerhut opened this issue Aug 15, 2023 · 0 comments
Labels
1.5 Issues and PRs that we want to go into 1.5 p4-language-compatibility An issue related to compatibility between P4_16 language spec and P4Runtime API spec

Comments

@jafingerhut
Copy link
Contributor

jafingerhut commented Aug 15, 2023

This issue should be closed exactly when the bullet item “Clarified restrictions for parameters with default values” in Section 1.1 "P4 Language Version Applicability" is addressed and removed.

This issue is related to the following change made from v1.2.3 to v1.2.4 of the P4_16 language specification:

  • Clarified restrictions for parameters with default values (Section 6.8.1).

(see https://p4.org/p4-spec/docs/P4-16-v1.2.4.html#sec-summary-of-changes-made-in-version-124 for the item in context of the full list of changes, but there are separate Github issues for each that might impact the P4Runtime API specification).

Seems related to this issue #433

The new text in version 1.2.4 is copied and pasted below:

  • If parameters with default values do not appear at the end of the list of parameters, invocations that use the default values must use named arguments, as in the following example:
extern void f(in bit a, in bit<3> b = 2, in bit<5> c);

void g()
{
  f(a = 1, b = 2, c = 3);  // ok
  f(a = 1, c = 3);  // ok, equivalent to the previous call, b uses default value
  f(1, 2, 3);       // ok, equivalent to the previous call
  // f(1, 3); // illegal, since the parameter b is not the last in the list
}
@jafingerhut jafingerhut added the p4-language-compatibility An issue related to compatibility between P4_16 language spec and P4Runtime API spec label Aug 15, 2023
@smolkaj smolkaj added the 1.4.0 Issues and PRs that we want to go into 1.4.0 label Jun 14, 2024
@smolkaj smolkaj added 1.5 Issues and PRs that we want to go into 1.5 and removed 1.4.0 Issues and PRs that we want to go into 1.4.0 labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.5 Issues and PRs that we want to go into 1.5 p4-language-compatibility An issue related to compatibility between P4_16 language spec and P4Runtime API spec
Projects
None yet
Development

No branches or pull requests

2 participants