Skip to content

warning: this use of "defined" may not be portable [-Wexpansion-to-defined] #248

Open
@hafenhuhn1

Description

@hafenhuhn1

When building with warnings enabled:

C:\path\to\HX711_Arduino_Library\src\HX711.cpp:31:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if HAS_ATOMIC_BLOCK
     ^~~~~~~~~~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:31:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if FAST_CPU
     ^~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:36:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:130:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
  #if HAS_ATOMIC_BLOCK
      ^~~~~~~~~~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:130:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:133:8: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
  #elif IS_FREE_RTOS
        ^~~~~~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:155:7: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
   #if ARCH_ESPRESSIF
       ^~~~~~~~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:155:7: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:159:7: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
   #if ARCH_ESPRESSIF
       ^~~~~~~~~~~~~~
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:159:7: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
C:\path\to\HX711_Arduino_Library\src\HX711.cpp:164:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
  #if IS_FREE_RTOS
      ^~~~~~~~~~~~

I think it's complaining that your are trying to use the value of a #define in an #if, which may not be portable. See https://stackoverflow.com/questions/42074035/how-to-deal-with-clangs-3-9-wexpansion-to-defined-warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions