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

Example P4 program where const gives error when used as bit slice low/high value #4961

Open
jafingerhut opened this issue Oct 12, 2024 · 0 comments

Comments

@jafingerhut
Copy link
Contributor

I tried reporting a different program that I thought gave a similar error before, and closed it because I could not reproduce it, but this one gives the error with a recent version of p4c source code:

$ git clone https://github.com/jafingerhut/p4-guide
$ cd p4-guide/loop-test-progs
$ p4test err-const-is-not-compile-time-known-value1.p4 
err-const-is-not-compile-time-known-value1.p4(57): [--Werror=type-error] error: i: slice bit index values must be constants
            n[i:i] = 1;
              ^

$ p4test --version
p4test
Version 1.2.4.16 (SHA: d2006d52e BUILD: RELEASE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant