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

ztest.c: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination #1480

Closed
ryao opened this issue May 29, 2013 · 0 comments
Labels
Type: Building Indicates an issue related to building binaries
Milestone

Comments

@ryao
Copy link
Contributor

ryao commented May 29, 2013

Gentoo's package manager warned about the following QA issue when building the ZFS userland tools:

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * ../../cmd/ztest/ztest.c:2584:33: warning: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]

 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: http://zfsonlinux.org/

That warning was generated by GCC 4.8.0. I consider this to be a low priority issue, but I am filing an issue for it anyway.

ryao added a commit to ryao/zfs that referenced this issue Jul 2, 2013
This silences a GCC 4.8.0 warning by fixing a programming error caught by
static analysis:

../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
    (void) snprintf(path, sizeof (path), ztest_aux_template,
                                 ^

Closes openzfs#1480

Signed-off-by: Richard Yao <[email protected]>
unya pushed a commit to unya/zfs that referenced this issue Dec 13, 2013
This silences a GCC 4.8.0 warning by fixing a programming error
caught by static analysis:

../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’
  in ‘snprintf’ call is the same expression as the destination;
  did you mean to provide an explicit length?
  [-Werror=sizeof-pointer-memaccess]
  (void) snprintf(path, sizeof (path), ztest_aux_template,
                                 ^

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#1480
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant