qapi: Add "errno" to the list of polluted words
authorMax Reitz <mreitz@redhat.com>
Fri, 20 Dec 2013 18:28:18 +0000 (19:28 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 22 Jan 2014 11:07:18 +0000 (12:07 +0100)
Using "errno" directly as an identifier results in various syntax
errors; therefore it should be added to the list of polluted words.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scripts/qapi.py

index 750e9fb5521e79a99c4ba91ea987996ce30e5a53..9b3de4c7c3d2d1a376d6cfe194f6f5b6fbf60433 100644 (file)
@@ -247,7 +247,7 @@ def c_var(name, protect=True):
                      'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not',
                      'not_eq', 'or', 'or_eq', 'xor', 'xor_eq'])
     # namespace pollution:
-    polluted_words = set(['unix'])
+    polluted_words = set(['unix', 'errno'])
     if protect and (name in c89_words | c99_words | c11_words | gcc_words | cpp_words | polluted_words):
         return "q_" + name
     return name.replace('-', '_').lstrip("*")