4 # ***** BEGIN GPL LICENSE BLOCK *****
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # Contributor(s): Campbell Barton
22 # ***** END GPL LICENSE BLOCK *****
26 CHECKER_IGNORE_PREFIX = [
31 CHECKER_BIN = "splint"
48 # we may want to remove these later
56 "-bufferoverflowhigh", # warns a lot about sprintf()
58 # re-definitions, rna causes most of these
64 import project_source_info
70 source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX)
73 for c, inc_dirs, defs in source_info:
74 cmd = ([CHECKER_BIN] +
77 [("-I%s" % i) for i in inc_dirs] +
78 [("-D%s" % d) for d in defs]
81 check_commands.append((c, cmd))
83 for i, (c, cmd) in enumerate(check_commands):
84 percent = 100.0 * (i / (len(check_commands) - 1))
85 percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
87 sys.stdout.write("%s %s\n" % (percent_str, c))
90 process = subprocess.Popen(cmd)
93 if __name__ == "__main__":