summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2015-12-12 14:47:21 -0800
committerEli Bendersky <eliben@gmail.com>2015-12-12 14:47:21 -0800
commit904cecd150c2c5c768944d199169957cdb8433f9 (patch)
tree08247a9dabddca84b998c288c5ebfd7a8fb3c326 /examples
parentdbb018e302ae1946afec6afb481817cd42939079 (diff)
downloadpycparser-904cecd150c2c5c768944d199169957cdb8433f9.tar.gz
Add fake libc path to func_defs.py
Diffstat (limited to 'examples')
-rw-r--r--examples/func_defs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/func_defs.py b/examples/func_defs.py
index eacca41..552f860 100644
--- a/examples/func_defs.py
+++ b/examples/func_defs.py
@@ -5,7 +5,7 @@
# C file.
#
# This is a simple example of traversing the AST generated by
-# pycparser.
+# pycparser. Call it from the root directory of pycparser.
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
@@ -30,7 +30,8 @@ class FuncDefVisitor(c_ast.NodeVisitor):
def show_func_defs(filename):
# Note that cpp is used. Provide a path to your own cpp or
# make sure one exists in PATH.
- ast = parse_file(filename, use_cpp=True)
+ ast = parse_file(filename, use_cpp=True,
+ cpp_args=r'-Iutils/fake_libc_include')
v = FuncDefVisitor()
v.visit(ast)