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

Compiler warnings #512

Closed
rossb93 opened this issue Apr 23, 2024 · 1 comment
Closed

Compiler warnings #512

rossb93 opened this issue Apr 23, 2024 · 1 comment

Comments

@rossb93
Copy link

rossb93 commented Apr 23, 2024

I currently get the 4 compiler warnings in my usage of CANopenNode:

\301\CO_Emergency.c(374): warning: unused variable 'odRet' [-Wunused-variable] 374 | ODR_t odRet;

and

305\CO_LSSslave.c(41): warning: 'CO_LSS_FASTSCAN_BIT0' is not defined, evaluates to 0 [-Wundef] 41 | #if CO_LSS_FASTSCAN_BIT0!=0 || CO_LSS_FASTSCAN_VENDOR_ID!=0 || CO_LSS_BIT_TIMING_1000!=0 | ^ 305\CO_LSSslave.c(41): warning: 'CO_LSS_FASTSCAN_VENDOR_ID' is not defined, evaluates to 0 [-Wundef] 41 | #if CO_LSS_FASTSCAN_BIT0!=0 || CO_LSS_FASTSCAN_VENDOR_ID!=0 || CO_LSS_BIT_TIMING_1000!=0 | ^ 305\CO_LSSslave.c(41): warning: 'CO_LSS_BIT_TIMING_1000' is not defined, evaluates to 0 [-Wundef] 41 | #if CO_LSS_FASTSCAN_BIT0!=0 || CO_LSS_FASTSCAN_VENDOR_ID!=0 || CO_LSS_BIT_TIMING_1000!=0

Proposed fixes are:
#if (CO_CONFIG_EM) ODR_t odRet; #endif

so odRet is only used if CO_CONFIG_EM is not 0.

and

remove

#if CO_LSS_FASTSCAN_BIT0!=0 || CO_LSS_FASTSCAN_VENDOR_ID!=0 || CO_LSS_BIT_TIMING_1000!=0 #error Inconsistency in LSS macros #endif
as can't use #if directive with enums.

CANopenNode added a commit that referenced this issue Apr 25, 2024
@CANopenNode
Copy link
Owner

Fixed as you proposed, ODR_t odRet; moved after #if (CO_CONFIG_EM)...

Thank you.

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

2 participants