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
62 # dummy, witjout this splint complains with:
63 # /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
68 import project_source_info
74 source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX)
77 for c, inc_dirs, defs in source_info:
78 cmd = ([CHECKER_BIN] +
81 [("-I%s" % i) for i in inc_dirs] +
82 [("-D%s" % d) for d in defs]
85 check_commands.append((c, cmd))
87 def my_process(i, c, cmd):
88 percent = 100.0 * (i / (len(check_commands) - 1))
89 percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
91 sys.stdout.write("%s %s\n" % (percent_str, c))
94 return subprocess.Popen(cmd)
96 process_functions = []
97 for i, (c, cmd) in enumerate(check_commands):
98 process_functions.append((my_process, (i, c, cmd)))
100 project_source_info.queue_processes(process_functions)
103 if __name__ == "__main__":