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

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

Open
hafenhuhn1 opened this issue Mar 26, 2023 · 0 comments

Comments

@hafenhuhn1
Copy link

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

WebFreak001 added a commit to WebFreak001/HX711 that referenced this issue Mar 26, 2023
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

No branches or pull requests

1 participant