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

Can compare extern objects equal/not equal? #3363

Closed
apinski-cavium opened this issue May 26, 2022 · 1 comment · Fixed by #3834
Closed

Can compare extern objects equal/not equal? #3363

apinski-cavium opened this issue May 26, 2022 · 1 comment · Fixed by #3834
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed. question This is a topic requesting clarification.

Comments

@apinski-cavium
Copy link

I accidently found this while testing something related to annotations.
Take:

extern e
{
  e();
}
e() t;
e() t1;

@myat[t == t1] typedef int b1;

As far as I Know you cannot compare extern objects with == or !=. But p4c accepts it.

@mihaibudiu mihaibudiu added the question This is a topic requesting clarification. label Aug 18, 2022
@mihaibudiu
Copy link
Contributor

This should be disallowed.

@mihaibudiu mihaibudiu added bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed. labels Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed. question This is a topic requesting clarification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants