xref: /aosp_15_r20/external/fsverity-utils/scripts/run-sparse.sh (revision b13c0e4024008a1f948ee8189745cb3371f4ac04)
1*b13c0e40SEric Biggers#!/bin/bash
2*b13c0e40SEric Biggers# SPDX-License-Identifier: MIT
3*b13c0e40SEric Biggers# Copyright 2020 Google LLC
4*b13c0e40SEric Biggers#
5*b13c0e40SEric Biggers# Use of this source code is governed by an MIT-style
6*b13c0e40SEric Biggers# license that can be found in the LICENSE file or at
7*b13c0e40SEric Biggers# https://opensource.org/licenses/MIT.
8*b13c0e40SEric Biggers
9*b13c0e40SEric Biggersset -e -u -o pipefail
10*b13c0e40SEric Biggers
11*b13c0e40SEric Biggersfind programs lib -name '*.c' | while read -r file; do
12*b13c0e40SEric Biggers	sparse "$file" -gcc-base-dir "$(gcc --print-file-name=)"	\
13*b13c0e40SEric Biggers		-Iinclude -D_FILE_OFFSET_BITS=64 -Wbitwise -D_GNU_SOURCE
14*b13c0e40SEric Biggersdone
15