scripts/checker-valid.sh

Source file repositories/reference/linux-study-clean/scripts/checker-valid.sh

File Facts

System
Linux kernel
Corpus path
scripts/checker-valid.sh
Extension
.sh
Size
419 bytes
Lines
20
Domain
Support Tooling And Documentation
Bucket
scripts
Inferred role
Support Tooling And Documentation: scripts
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/sh -eu
# SPDX-License-Identifier: GPL-2.0

[ ! -x "$(command -v "$1")" ] && exit 1

tmp_file=$(mktemp)
trap "rm -f $tmp_file" EXIT

cat << EOF >$tmp_file
static inline int u(const int *q)
{
	__typeof_unqual__(*q) v = *q;
	return v;
}
EOF

# sparse happily exits with 0 on error so validate
# there is none on stderr. Use awk as grep is a pain with sh -e
$@ $tmp_file 2>&1 | awk -v c=1 '/error/{c=0}END{print c}'

Annotation

Implementation Notes