summaryrefslogtreecommitdiffstats
path: root/scripts/tracetool
diff options
context:
space:
mode:
authorStefan Hajnoczi2018-01-10 21:25:53 +0100
committerStefan Hajnoczi2018-01-29 11:34:55 +0100
commit24f4d3d3aeabf83445839099d6d66cbb3089c37a (patch)
treec1a40c2b92e2890163be8553e11274d27b4eb1e0 /scripts/tracetool
parenttracetool: clarify that "formats" means "format strings" (diff)
downloadqemu-24f4d3d3aeabf83445839099d6d66cbb3089c37a.tar.gz
qemu-24f4d3d3aeabf83445839099d6d66cbb3089c37a.tar.xz
qemu-24f4d3d3aeabf83445839099d6d66cbb3089c37a.zip
tracetool: report error on foo() instead of foo(void)
C functions with no arguments must be declared foo(void) instead of foo(). The tracetool argument list parser has never accepted an empty argument list. This patch adds a clear error message for this error case. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20180110202553.31889-4-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool')
-rw-r--r--scripts/tracetool/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index e3685bd0ca..1a9733da9a 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -75,6 +75,8 @@ class Arguments:
res = []
for arg in arg_str.split(","):
arg = arg.strip()
+ if not arg:
+ raise ValueError("Empty argument (did you forget to use 'void'?)")
if arg == 'void':
continue