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

GCC 9.0: ztest "directive argument is not a nul-terminated string" #8330

Closed
tonyhutter opened this issue Jan 23, 2019 · 0 comments
Closed

GCC 9.0: ztest "directive argument is not a nul-terminated string" #8330

tonyhutter opened this issue Jan 23, 2019 · 0 comments
Assignees
Labels
Type: Building Indicates an issue related to building binaries
Projects

Comments

@tonyhutter
Copy link
Contributor

System information

Type Version/Name
Distribution Name Fedora
Distribution Version 30 (rawhide)
Linux Kernel 5.0.0-0.rc3.git0.1.fc30.x86_64
Architecture x86-64
ZFS Version master
SPL Version master

Describe the problem you're observing

GCC is complaining because we're trying to print a string that's defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

This seems to fix it:

--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -183,8 +183,8 @@ typedef struct ztest_shared_opts {
 } ztest_shared_opts_t;
 
 static const ztest_shared_opts_t ztest_opts_defaults = {
-       .zo_pool = { 'z', 't', 'e', 's', 't', '\0' },
-       .zo_dir = { '/', 't', 'm', 'p', '\0' },
+       .zo_pool = "ztest",
+       .zo_dir = "/tmp",
        .zo_alt_ztest = { '\0' },
        .zo_alt_libpath = { '\0' },
        .zo_vdevs = 5,

Describe how to reproduce the problem

Using master in rawhide:

./autogen.sh && ./configure --enable-debug --with-config=srpm
make rpm-utils

Include any warning/errors/backtraces from the system logs

make[5]: Entering directory '/tmp/zfs-build-hutter-bHS6nGig/BUILD/zfs-0.8.0/cmd/ztest'
  CC       ztest.o
ztest.c: In function 'usage':
ztest.c:679:29: error: '%s' directive argument is not a nul-terminated string [-Werror=format-overflow=]
  679 |  (void) fprintf(fp, "Usage: %s\n"
      |                             ^~
ztest.c:185:34: note: referenced argument declared here
  185 | static const ztest_shared_opts_t ztest_opts_defaults = {
      |                                  ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
@tonyhutter tonyhutter added the Type: Building Indicates an issue related to building binaries label Jan 23, 2019
@tonyhutter tonyhutter self-assigned this Jan 23, 2019
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 23, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making it an actual strings.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: openzfs#8330
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 23, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making it an actual strings.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: openzfs#8330
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 25, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: openzfs#8330
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 30, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 4, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
Requires-spl: openzfs#713
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 5, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
Requires-spl: refs/pull/713/head
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 8, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
Requires-spl: refs/pull/713/head
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 12, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
Requires-spl: refs/pull/713/head
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 19, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8330
tonyhutter added a commit that referenced this issue Mar 4, 2019
GCC 9.0 is complaining because we're trying to print strings that
are defined like this:

.zo_pool = { 'z', 't', 'e', 's', 't', '\0' },

Fix them by making them actual strings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #8330
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
No open projects
0.7.13
  
Awaiting triage
Development

No branches or pull requests

1 participant