Skip to content

abs() not recognized as function if not after equals sign #902

@blopa1961

Description

@blopa1961

Describe the bug

In arduino IDE abs() get marked as "no matching function for call to 'abs'" if it does not follow an equals sign.
(the program compiles without errors)

To Reproduce

Steps to reproduce the behavior:
in a new sketch select nodeMCU 1.0
write a statement like:

if (abs(i) < j) {
  etc...
}

abs (i) gets flagged as error in the IDE: "no matching function call for 'abs'"

k= abs(i); // this does not get flagged

same problem occurs if sprintf is not assigned to a variable, example:

sprintf(deciSecs, "%.1f",((float) timeStep) / 1000.0);

instead of

i= sprintf( etc... );

Expected behavior

I didn't expect this to be flagged

Desktop

  • Arduino IDE 2.0.0-rc5
  • OS: Windows 10 Pro
  • Version: 21H2

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions