oxidecomputer / p4

A P4 compiler
Mozilla Public License 2.0
112 stars 5 forks source link

Add a static analysis check for uninitialized reads #7

Open rcgoodfellow opened 2 years ago

rcgoodfellow commented 2 years ago

For context see this wiki entry.

https://github.com/oxidecomputer/p4/wiki/P4-Specification-Notes#reading-uninitialized-values

The P4 language design working group has stated that P4 is an unsafe language. So what I suggested as a better alternative in the wiki entry above will likely not be realized in the foreseeable future. However, we can try to detect these sorts of uses as much as possible at compile time.