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

kpartx/devmapper.c: fix build errors caused by -Werror on unused variables #23

Closed
wants to merge 2 commits into from

Commits on Dec 25, 2021

  1. kpartx/devmapper.c: fix unused-but-set variable error

    On gcc-12 build failed as:
    
        devmapper.c: In function 'dm_simplecmd':
        devmapper.c:61:13: error: unused variable 'udev_wait_flag' [-Werror=unused-variable]
           61 |         int udev_wait_flag = (task == DM_DEVICE_RESUME ||
              |             ^~~~~~~~~~~~~~
    
    Fix error by hiding it's declaration under #ifdef that uses it.
    trofi committed Dec 25, 2021
    Configuration menu
    Copy the full SHA
    44a6d0a View commit details
    Browse the repository at this point in the history
  2. kpartx/devmapper.c: fix unused variable error

    Without the change the build fails as:
    
        devmapper.c:58:69: error: unused parameter 'udev_flags' [-Werror=unused-parameter]
           58 | int dm_simplecmd(int task, const char *name, int no_flush, uint16_t udev_flags)
              |                                                            ~~~~~~~~~^~~~~~~~~~
    
    The change adds __attribute__((used)) annotation to unused function parameter.
    trofi committed Dec 25, 2021
    Configuration menu
    Copy the full SHA
    bcba814 View commit details
    Browse the repository at this point in the history