the pio compiler tells me this way it isnt possible cuz the expression should be a constant value. its possible to upload cuz it should be a warning only and also it works. the same code the arduino ide compile without this warning and upload also works. its just annoying and i want to know why this happen. can someone tell me please.
By default, warnings are not displayed in the Arduino IDE. Have you enabled verbose output in the preferences?
Additionally, the Arduino IDE uses different compiler settings. In particular, it checks for fewer potential problems and emits fewer warnings. So even if you enable verbose output, you might get less warnings than with PlatformIO.
In short: the Arduino IDE makes you feel good by hiding warnings. But there is a potential problem in your code anyway.