Changeset ed63298 in mainline
- Timestamp:
- 2010-01-05T16:08:57Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3d513f
- Parents:
- 679c361
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/checkers/vcc.py
r679c361 red63298 2 2 # 3 3 # Copyright (c) 2010 Martin Decky 4 # Copyright (c) 2010 Ondrej Sery 4 5 # All rights reserved. 5 6 # … … 51 52 52 53 def preprocess(srcfname, tmpfname, base, options): 53 "Preprocess source using GCC preprocessor "54 "Preprocess source using GCC preprocessor and compatibility tweaks" 54 55 55 56 args = ['gcc', '-E'] 56 57 args.extend(options.split()) 57 args.extend(['-o', tmpfname, srcfname]) 58 args.append(srcfname) 59 60 # Change working directory 58 61 59 62 cwd = os.getcwd() 60 63 os.chdir(base) 61 retval = subprocess.Popen(args).wait() 64 65 preproc = subprocess.Popen(args, stdout = subprocess.PIPE).communicate()[0] 66 67 tmpf = file(tmpfname, "w") 68 69 for line in preproc.splitlines(): 70 # Ignore preprocessor directives 71 if (line.startswith('#')): 72 continue 73 74 tmpf.write("%s\n" % line) 75 76 tmpf.close() 77 62 78 os.chdir(cwd) 63 64 if (retval != 0):65 return False66 79 67 80 return True
Note:
See TracChangeset
for help on using the changeset viewer.