Skip to content

Fix compilation errors#39

Open
dwrobel wants to merge 1 commit intocpetrich:masterfrom
dwrobel:Fix-compilation-errors
Open

Fix compilation errors#39
dwrobel wants to merge 1 commit intocpetrich:masterfrom
dwrobel:Fix-compilation-errors

Conversation

@dwrobel
Copy link

@dwrobel dwrobel commented Aug 14, 2024

Fixes the following compilation errors:

discover_fake_DS18B20.ino: In function 'void setup()': discover_fake_DS18B20.ino:94:18: error: ISO C++ forbids
converting a string constant to 'char*' [-Werror=write-strings]
94 | char *file = FILE;
| ^~~~~~~~
discover_fake_DS18B20.ino: In function 'void loop()':
discover_fake_DS18B20.ino:277:23: error: comparison is always true
due to limited range of data type [-Werror=type-limits]
277 | ((buffer2[6] >= 0x00) && (buffer2[6] <= 0x10)) ){
| ~~~~~~~~~~~^~~~~~~

classify_fake_DS18B20.ino:328:38: error: comparison of promoted
bitwise complement of an unsigned value with unsigned
[-Werror=sign-compare]
328 | if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
| ~~~~~~^~~~~~~~
328 | if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
| ~~~~~~^~~~~~~~

Fixes the following compilation errors:

discover_fake_DS18B20.ino: In function 'void setup()':
discover_fake_DS18B20.ino:94:18: error: ISO C++ forbids
  converting a string constant to 'char*' [-Werror=write-strings]
   94 |     char *file = __FILE__;
      |                  ^~~~~~~~
discover_fake_DS18B20.ino: In function 'void loop()':
discover_fake_DS18B20.ino:277:23: error: comparison is always true
  due to limited range of data type [-Werror=type-limits]
  277 |          ((buffer2[6] >= 0x00) && (buffer2[6] <= 0x10)) ){
      |            ~~~~~~~~~~~^~~~~~~

classify_fake_DS18B20.ino:328:38: error: comparison of promoted
  bitwise complement of an unsigned value with unsigned
    [-Werror=sign-compare]
  328 |       if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
      |            ~~~~~~^~~~~~~~
  328 |       if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
      |                                ~~~~~~^~~~~~~~

Signed-off-by: Damian Wrobel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant