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

False positive "this equal statement has no effect" warning #1386

Open
volsa opened this issue Jan 13, 2025 · 0 comments
Open

False positive "this equal statement has no effect" warning #1386

volsa opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working low-priority validation candidate for syntactic or semantic validation

Comments

@volsa
Copy link
Member

volsa commented Jan 13, 2025

Describe the bug
The following code

{external}
FUNCTION printf : DINT
  VAR_INPUT {ref}
    format : STRING;
  END_VAR
  VAR_INPUT
    args : ...;
  END_VAR
END_FUNCTION

FUNCTION main
  VAR
    a : DINT;
  END_VAR

  printf('%d', a = 1);
END_FUNCTION

will return

warning[E023]: This equal statement has no effect, did you mean `a := 1`?
   ┌─ target/demo.st:16:16
   │
16 │   printf('%d', a = 1);
   │                ^^^^^ This equal statement has no effect, did you mean `a := 1`?

I just wanted this to be documented with a simple reproducible example, however this needs further investigation.

@volsa volsa added bug Something isn't working validation candidate for syntactic or semantic validation low-priority labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low-priority validation candidate for syntactic or semantic validation
Projects
None yet
Development

No branches or pull requests

1 participant