[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] tracetool: report error on foo() instead of foo
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 3/3] tracetool: report error on foo() instead of foo(void) |
Date: |
Wed, 10 Jan 2018 20:25:53 +0000 |
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 <address@hidden>
---
scripts/tracetool/__init__.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 5db1f5c395..8e9efba78f 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
--
2.14.3
- [Qemu-devel] [PATCH 0/3] tracetool: improve error messages, Stefan Hajnoczi, 2018/01/10
- [Qemu-devel] [PATCH 1/3] tracetool: prefix parse errors with line numbers, Stefan Hajnoczi, 2018/01/10
- [Qemu-devel] [PATCH 3/3] tracetool: report error on foo() instead of foo(void),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 2/3] tracetool: clarify that "formats" means "format strings", Stefan Hajnoczi, 2018/01/10
- Re: [Qemu-devel] [PATCH 0/3] tracetool: improve error messages, Eric Blake, 2018/01/10
- Re: [Qemu-devel] [PATCH 0/3] tracetool: improve error messages, no-reply, 2018/01/10
- Re: [Qemu-devel] [PATCH 0/3] tracetool: improve error messages, Stefan Hajnoczi, 2018/01/15