sparse(1) General Commands Manual sparse(1) (NAME) sparse - C (SYNOPSIS) sparse [WARNING OPTIONS]... file.c (DESCRIPTION) Sparse C . Sparse . Sparse -Wsomething . Sparse -Wno-something . (WARNING OPTIONS) -fmax-errors=COUNT COUNT "unlimited" . 100 . -fmax-warnings=COUNT COUNT "unlimited" . 100 . -Wsparse-all sparse -Wno-something . -Wsparse-error sparse . -Waddress-space . Sparse __attribute__((address_space(id))) id ( ) . -Waddress-space Sparse . Sparse (cast) ( ) . uintptr_t ( unsigned long) << >> . __attribute__((force)) . Sparse . -Wno-address-space . -Wbitwise . Sparse __attribute__((bitwise)) typedef . typedef (endianness) . -Wbitwise Sparse __attribute__((force)) . __bitwise << >> . __bitwise * * ( 0 - <> ). <> << >> __bitwise : ** . Sparse . -Wno-bitwise . -Wbitwise-pointer -Wbitwise bitwise. Sparse . -Wcast-from-as . -Waddress-space unsigned long . Sparse . -Wcast-to-as . __attribute__((force)) . uintptr_t ( unsigned long) . Sparse . -Wcast-truncate (truncate) . Sparse . -Wno-cast-truncate . -Wconstant-suffix ( ) . int long 0x100000000U unsigned int unsigned long . unsigned long . UL : 0x100000000UL. Sparse . -Wconstexpr-not-const . (static storage duration) . Sparse . -Wcontext . Sparse ( ) . __attribute__((context(expression,in_context,out_context)) expression ( ) in_context ( ) out_context ( ) . API __context__(expression,in_value,out_value) . -Wcontext Sparse context ( ) ( ). Sparse . Sparse . -Wno-context . -Wdecl -static . ( ) static . (header). . -Wdecl Sparse static . static ( ). Sparse . -Wno-decl . -Wdeclaration-after-statement . C99 C89 . Sparse C C89 ( -ansi -std=c89). -Wno-declaration-after-statement . -Wdefault-bitfield-sign (bitfield) (signedness) . (C99 6.7.2). signed unsigned . signed unsigned . Sparse . -Wdesignated-init (designated initializers) . Sparse __attribute__((designated_init)) (struct) . Sparse . (layout) . NULL . Sparse . -Wno-designated-init . -Wdo-while do- while . Sparse . -Wenum-mismatch enum enum enum enum . Sparse . -Wno-enum-mismatch . -Wexternal-function-has-definition (external linkage) . Sparse . -Wno-external-function-has-definition . -Wflexible-array-array (flexible array) . Sparse . -Wno-flexible-array-array . -Wflexible-array-nested union . Sparse . -Wflexible-array-sizeof sizeof . Sparse . -Wflexible-array-union union. -Wflexible-array-array -Wflexible-array-nested -Wflexible-array-sizeof . Sparse . -Winit-cstring char C . char nul : char s[3] = "abc"; C . C printf(%s) strcmp . Sparse . -Wmemcpy-max-count memcpy() memset() copy_from_user() copy_to_user() . Sparse . -Wno-memcpy-max-count . -fmemcpy-max-count=COUNT 100000 . -Wnewline-eof (newline) . Sparse . -Wno-newline-eof . -Wnon-pointer-null 0 NULL. 0 (integer) . NULL . Sparse . -Wno-non-pointer-null . -Wold-initializer C99 GCC . C99 struct union : struct structname var = { .field = value }; GCC C99 : struct structname var = { field: value }; Sparse GCC . C99 . Sparse . -Wno-old-initializer . -Wone-bit-signed-bitfield signed. signed 0 -1 0 0 1 . Sparse . -Wno-one-bit-signed-bitfield . -Wparen-string . C . GCC (extension) . -Wparen-string Sparse . Sparse . -Wpast-deep-designator (initializer-list) (designator) () . Sparse . -Wpointer-arith sizeof void . C99 sizeof void . GCC (extension) sizeof 1 . -pointer-arith Sparse void sizeof void . Sparse . -Wptr-subtraction-blows . . . . Sparse . -Wreturn-void void void . C99 typeof . -Wreturn-void . Sparse . -Wshadow (scope) (shadow ) . . Sparse . -Wshift-count-negative . Sparse . -Wshift-count-overflow (operand) . Sparse . -Wsizeof-bool sizeof _Bool . C99 _Bool . GCC 1 . Sparse . -Wtransparent-union GCC __attribute__((transparent_union)) . Sparse . -Wno-transparent-union . -Wtypesign (signedness) . Sparse . -Wundef . C ( C99 6.10.1) 0 . . Sparse . -Wuniversal-initializer '{ 0 }' '{ }' (aggregate types) (universal initializer) . -Wdesignated-init -Wnon-pointer-null . Sparse '{ 0 }' '{ }' . -Wunion-cast (cast) union . Sparse . --arch=ARCH . (mips powerpc riscv sparc) 32 64 . Sparse . -gcc-base-dir dir dir/include/ dir/include-fixed/ . -multiarch-dir dir (multiarch) dir . dir (normalized GNU triplet) ( i386-linux-gnu). --os=OS . . : linux unix freebsd netbsd opensd sunos darwin cygwin. Sparse . (DEBUG OPTIONS) -fmem-report . (OTHER OPTIONS) -fdiagnostic-prefix[=PREFIX] PREFIX ": " . "sparse" . . -fmemcpy-max-count=COUNT -Wmemcpy-max-count . COUNT 'unlimited' '0' . 100000 . -ftabstop=WIDTH (tab stop) . sparse . . . -f[no-]unsigned-bitfields, -f[no-]signed-bitfields (bitfields) ('signed' 'unsigned') . . -f[no-]unsigned-char, -f[no-]signed-char 'char' . char . (SEE ALSO) cgcc(1) (HOMEPAGE) https://sparse.docs.kernel.org (MAILING LIST) linux-sparse@vger.kernel.org (CONTRIBUTING AND REPORTING BUGS) Sparse (linux-sparse@vger.kernel.org) . . : http://bugzilla.kernel.org/enter_bug.cgi?component=Sparse&product=Tools . Sparse : https://sparse.docs.kernel.org (AUTHORS) Sparse Linus Torvalds . : https://www.openhub.net/p/sparse/contributors . Chris Li Sparse . sparse(1)