summaryrefslogtreecommitdiffstats
path: root/ppapi/generators
diff options
context:
space:
mode:
authormseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 02:05:31 +0000
committermseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 02:05:31 +0000
commit32eb1c5336c83a75267c9773b323817e9992aa51 (patch)
tree992ed77be53d6362a20957fb6f8095fe0953f0ad /ppapi/generators
parentd1e9d39661446283343f6a445ee9863959b0e0ae (diff)
downloadchromium_src-32eb1c5336c83a75267c9773b323817e9992aa51.zip
chromium_src-32eb1c5336c83a75267c9773b323817e9992aa51.tar.gz
chromium_src-32eb1c5336c83a75267c9773b323817e9992aa51.tar.bz2
Make PPAPI headers compilable with -Wstrict-prototypes
This changes the PPAPI headers to use "foo(void)" rather than "foo()" in function prototypes and definitions. In C (but not C++), "foo()" declares a function with unspecified arguments, which allows foo to be called with excess arguments or implemented with excess arguments. Using "foo(void)" is more correct and will prevent such mistakes. GCC's -Wstrict-prototypes warning requires using "foo(void)", and we'd like to turn this warning on for NaCl C code. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3114 TEST= rerun ppapi/generators/generator.py + compile Review URL: https://codereview.chromium.org/11419192 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators')
-rwxr-xr-xppapi/generators/idl_c_proto.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py
index fea5615..7df8311 100755
--- a/ppapi/generators/idl_c_proto.py
+++ b/ppapi/generators/idl_c_proto.py
@@ -412,6 +412,8 @@ class CGen(object):
ptr_prefix='', include_name=True))
if func_as_ptr:
name = '(%s*%s)' % (ptr_prefix, name)
+ if not params:
+ params = ['void']
out = '%s %s(%s)' % (rtype, name, ', '.join(params))
self.LogExit('Exit Compose: %s' % out)
return out