File: check-xfunc-usage.sh

package info (click to toggle)
openrc 0.63-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,412 kB
  • sloc: ansic: 16,255; sh: 2,225; perl: 28; makefile: 26
file content (16 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

top_srcdir=${SOURCE_ROOT:-..}
. ${top_srcdir}/test/setup_env.sh

ebegin "Checking for x* func usage"
out=$(cd ${top_srcdir}; find src -name '*.[ch]' \
	! -name queue.h \
	-exec grep -n -E '\<(malloc|strdup)[[:space:]]*\(' {} + \
	| grep -v -E \
		-e '__attribute__[[:space:]]*\(\(malloc' \
		-e src/shared/helpers.h \
		-e src/libeinfo/libeinfo.c)

[ -z "${out}" ]
eend $? "These need to be using the x* variant:"$'\n'"${out}"