LinuxGuruz
  • Last 5 Forum Topics
    Replies
    Views
    Last post


The Web Only This Site
  • BOOKMARK

  • ADD TO FAVORITES

  • REFERENCES


  • MARC

    Mailing list ARChives
    - Search by -
     Subjects
     Authors
     Bodies





    FOLDOC

    Computing Dictionary




  • Text Link Ads






  • LINUX man pages
  • Linux Man Page Viewer


    The following form allows you to view linux man pages.

    Command:

    sparse

    
    
    

    SYNOPSIS

           sparse [WARNING OPTIONS]... file.c
    
    
    

    DESCRIPTION

           Sparse  parses  C  source  and  looks for errors, producing warnings on
           standard error.
    
           Sparse accepts options controlling the set of warnings to generate.  To
           turn  on warnings Sparse does not issue by default, use the correspond-
           ing  warning  option  -Wsomething.   Sparse  issues  some  warnings  by
           default;  to  turn off those warnings, pass the negation of the associ-
           ated warning option, -Wno-something.
    
    
    

    WARNING OPTIONS

           -Wsparse-all
                  Turn on all sparse warnings, except for  those  explicitly  dis-
                  abled via -Wno-something.
    
           -Waddress-space
                  Warn  about  code  which  mixes  pointers  to  different address
                  spaces.
    
                  Sparse        allows        an        extended         attribute
                  __attribute__((address_space(num)))  on  pointers,  which desig-
                  nates a pointer target in address space num  (a  constant  inte-
                  ger).  With -Waddress-space, Sparse treats pointers with identi-
                  cal target types but different address spaces as distinct types.
                  To  override  this  warning, such as for functions which convert
                  pointers between  address  spaces,  use  a  type  that  includes
                  __attribute__((force)).
    
                  Sparse  issues these warnings by default.  To turn them off, use
                  -Wno-address-space.
    
           -Wbitwise
                  Warn  about  unsupported  operations  or  type  mismatches  with
                  restricted integer types.
    
                  Sparse supports an extended attribute, __attribute__((bitwise)),
                  which creates a new restricted integer type from a base  integer
                  type,  distinct  from  the  base integer type and from any other
                  restricted integer type not declared in the same declaration  or
                  typedef.   For  example, this allows programs to create typedefs
                  for integer types with  specific  endianness.   With  -Wbitwise,
                  Sparse  will  warn on any use of a restricted type in arithmetic
                  operations other than bitwise operations, and on any  conversion
                  of  one  restricted  type  into  another, except via a cast that
                  includes __attribute__((force)).
    
                  Sparse does not issue these warnings by default.
    
           -Wcast-to-as
                  Warn about potential errors in synchronization or  other  delim-
                  ited contexts.
    
                  Sparse supports several means of designating functions or state-
                  ments that delimit contexts, such as synchronization.  Functions
                  with   the   extended  attribute  __attribute__((context(expres-
                  sion,in_context,out_context))  require  the  context  expression
                  (for  instance, a lock) to have the value in_context (a constant
                  nonnegative integer) when called,  and  return  with  the  value
                  out_context  (a constant nonnegative integer).  For APIs defined
                  via  macros,  use   the   statement   form   __context__(expres-
                  sion,in_value,out_value) in the body of the macro.
    
                  With  -Wcontext  Sparse will warn when it sees a function change
                  the context without indicating this with  a  context  attribute,
                  either  by decreasing a context below zero (such as by releasing
                  a lock without acquiring it), or returning with a  changed  con-
                  text (such as by acquiring a lock without releasing it).  Sparse
                  will also warn about blocks of code which may  potentially  exe-
                  cute with different contexts.
    
                  Sparse  issues these warnings by default.  To turn them off, use
                  -Wno-context.
    
           -Wdecl Warn about any non-static variable or function  definition  that
                  has no previous declaration.
    
                  Private  symbols  (functions  and variables) internal to a given
                  source file should use  static,  to  allow  additional  compiler
                  optimizations,  allow  detection  of unused symbols, and prevent
                  other code from relying on these internal symbols.  Public  sym-
                  bols  used  by other source files will need declarations visible
                  to those other source files, such as in a header file.  All dec-
                  larations  should  fall into one of these two categories.  Thus,
                  with -Wdecl, Sparse warns about any symbol definition with  nei-
                  ther  static  nor  a  declaration.  To fix this warning, declare
                  private symbols static, and ensure that the files defining  pub-
                  lic  symbols  have the symbol declarations available first (such
                  as by including the appropriate header file).
    
                  Sparse issues these warnings by default.  To turn them off,  use
                  -Wno-decl.
    
           -Wdeclaration-after-statement
                  Warn about declarations that are not at the start of a block.
    
                  These declarations are permitted in C99 but not in C89.
    
                  Sparse  issues these warnings by default only when the C dialect
                  is C89  (i.e.  -ansi  or  -std=c89).   To  turn  them  off,  use
                  -Wno-declaration-after-statement.
    
    
                  Sparse  allows  an  attribute   __attribute__((designated_init))
                  which  marks  a  struct  as  requiring  designated initializers.
                  Sparse will warn about positional  initialization  of  a  struct
                  variable or struct literal of a type that has this attribute.
    
                  Requiring  designated  initializers for a particular struct type
                  will insulate code using that struct type from  changes  to  the
                  layout of the type, avoiding the need to change initializers for
                  that type unless  they  initialize  a  removed  or  incompatibly
                  changed field.
    
                  Common  examples  of  this type of struct include collections of
                  function pointers for the implementations of a class of  related
                  operations,  for which the default NULL for an unmentioned field
                  in a designated initializer will correctly indicate the  absence
                  of that operation.
    
                  Sparse  issues these warnings by default.  To turn them off, use
                  -Wno-designated-init.
    
           -Wdo-while
                  Warn about do-while loops that do not delimit the loop body with
                  braces.
    
                  Sparse does not issue these warnings by default.
    
           -Wenum-mismatch
                  Warn  about  the  use of an expression of an incorrect enum type
                  when initializing another enum type, assigning to  another  enum
                  type, or passing an argument to a function which expects another
                  enum type.
    
                  Sparse issues these warnings by default.  To turn them off,  use
                  -Wno-enum-mismatch.
    
           -Wnon-pointer-null
                  Warn about the use of 0 as a NULL pointer.
    
                  0 has integer type.  NULL has pointer type.
    
                  Sparse  issues these warnings by default.  To turn them off, use
                  -Wno-non-pointer-null.
    
           -Wold-initializer
                  Warn about the use of the pre-C99 GCC syntax for designated ini-
                  tializers.
    
                  C99  provides  a standard syntax for designated fields in struct
                  or union initializers:
    
                  struct structname var = { .field = value };
                  Warn about any one-bit signed bitfields.
    
                  A one-bit signed bitfield can only have the values 0 and -1,  or
                  with  some compilers only 0; this results in unexpected behavior
                  for programs which expected the ability to store 0 and 1.
    
                  Sparse issues these warnings by default.  To turn them off,  use
                  -Wno-one-bit-signed-bitfield.
    
           -Wparen-string
                  Warn  about  the  use of a parenthesized string to initialize an
                  array.
    
                  Standard C syntax does not permit a parenthesized string  as  an
                  array  initializer.   GCC  allows  this  syntax as an extension.
                  With -Wparen-string, Sparse will warn about this syntax.
    
                  Sparse does not issue these warnings by default.
    
           -Wptr-subtraction-blows
                  Warn when subtracting two pointers to a type with  a  non-power-
                  of-two size.
    
                  Subtracting  two  pointers to a given type gives a difference in
                  terms of the number of items of that  type.   To  generate  this
                  value,  compilers  will usually need to divide the difference by
                  the size of the type, an  potentially  expensive  operation  for
                  sizes other than powers of two.
    
                  Code  written  using  pointer  subtraction can often use another
                  approach instead, such as array indexing with an explicit  array
                  index variable, which may allow compilers to generate more effi-
                  cient code.
    
                  Sparse does not issue these warnings by default.
    
           -Wreturn-void
                  Warn if a function with return type void returns a void  expres-
                  sion.
    
                  C99 permits this, and in some cases this allows for more generic
                  code in macros that use typeof or take a type as a  macro  argu-
                  ment.   However,  some  programs  consider  this poor style, and
                  those programs can use -Wreturn-void to get warnings about it.
    
                  Sparse does not issue these warnings by default.
    
           -Wshadow
                  Warn when declaring a symbol which shadows  a  declaration  with
                  the same name in an outer scope.
    
                  Such declarations can lead to error-prone code.
                  Sparse does not issue these warnings by default.
    
           -Wundef
                  Warn about preprocessor conditionals that use the  value  of  an
                  undefined preprocessor symbol.
    
                  Standard  C (C99 6.10.1) permits using the value of an undefined
                  preprocessor symbol in preprocessor conditionals, and  specifies
                  it  has  have  a value of 0.  However, this behavior can lead to
                  subtle errors.
    
                  Sparse does not issue these warnings by default.
    
    
    

    MISC OPTIONS

           -gcc-base-dir dir
                  Look for compiler-provided system headers  in  dir/include/  and
                  dir/include-fixed/.
    
    
    

    OTHER OPTIONS

           -ftabstop=WIDTH
                  Set  the  distance  between tab stops.  This helps sparse report
                  correct column numbers in warnings or errors.  If the  value  is
                  less  than  1  or  greater than 100, the option is ignored.  The
                  default is 8.
    
    
    

    SEE ALSO

           cgcc(1)
    
    
    

    HOMEPAGE

           http://www.kernel.org/pub/software/devel/sparse/
    
    
    

    MAILING LIST

           linux-sparse@vger.kernel.org
    
    
    

    MAINTAINER

           Josh Triplett <josh@kernel.org>
    
                                                                         sparse(1)
    
  • MORE RESOURCE


  • Linux

    The Distributions





    Linux

    The Software





    Linux

    The News



  • MARKETING






  • Toll Free

webmaster@linuxguruz.com
Copyright © 1999 - 2016 by LinuxGuruz