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

Compilation Warnings when building CPP library #364

Open
bhvima opened this issue Mar 9, 2023 · 0 comments
Open

Compilation Warnings when building CPP library #364

bhvima opened this issue Mar 9, 2023 · 0 comments

Comments

@bhvima
Copy link

bhvima commented Mar 9, 2023

I am trying to make the library and I am getting the following warnings when compiling:

../../source/c_pwm.c: In function ‘pwm_setup’:
../../source/c_pwm.c:478:25: warning: ‘strncpy’ output may be truncated copying 250 bytes from a string of length 299 [-Wstringop-truncation]
                         strncpy(pwm_path, ecap_path_udev, sizeof(pwm_path));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../source/c_adc.c: In function ‘initialize_adc’:
../../source/c_adc.c:58:9: warning: ‘strncat’ specified bound 49 equals destination size [-Wstringop-overflow=]
         strncat(adc_prefix_dir, "/sys/bus/iio/devices/iio:device0/in_voltage", sizeof(adc_prefix_dir));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am not sure how to fix this issue. Any help would be appreciated.

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