p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
681 stars 445 forks source link

Terribly worded warning when field of an invalid header is written #4945

Open kfcripps opened 1 month ago

kfcripps commented 1 month ago

The pna-dpdk-header-union-stack1.p4 program results in the following warning:

...
pna-dpdk-header-union-stack1.p4(37): [--Wwarn=ignore-prop] warning: Result of 'hdr.h2[0].data = 16w1' is not defined: Error: Reading field from invalid header
        hdr.h2[0].data = 1;
                       ^

We should not have phrasing such as "Error: ..." in warning messages imo.

This is just one example but I think other warnings also have "Error: ..." in them.