[PATCH 0/9] misc sparse patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luc,

I noticed a couple of days ago, that the git.kernel.org sparse repo had
suddenly 'fast-forwarded' to just two commits behind the master branch
of your github sparse.git repo. As I mentioned before, I have been using
that branch as a base for my own patches (so that I don't suffer the
'sysmacros' warnings on newer versions of Linux). Tonight, I noticed
that it has 'fast-forwarded' again and is now at the same commit as the
base for my patches. So, I thought I may as well send these along ...
:-D

So, the base for these patches is commit 06a4545:

    $ git log --oneline master~1..dev
    8764999 (HEAD -> dev) constant: add -Wconstant-size warning
    5ed6580 pre-processor: add some pre-defined macros
    ffab79b pre-process: add the -dM option to dump macro definitions
    0449136 pre-process: print variable argument macros correctly
    49c61c8 pre-process: don't put spaces in macro parameter list
    c4b224c pre-process: print macros containing # and ## correctly
    4a45aea pre-process: suppress trailing space when dumping macros
    c9398e7 sparsei: add the --[no-]jit options
    dd6a13e sparsec: use a compatible exception model on cygwin
    06a4545 (origin/master, origin/HEAD, luc/master, master, luc-master) tokenize: check show_string() for NULL pointer
    $ 

Note that the final patch is marked RFC (see below).

Some brief notes about the patches:

  0001-sparsec-use-a-compatible-exception-model-on-cygwin.patch
  0002-sparsei-add-the-no-jit-options.patch

    The first two patches fix the use of the llvm tools on cygwin. The test
    suite had 64 test failures (55 + additional 9 fixed by these patches).
    The test suite now runs clean.

  0003-pre-process-suppress-trailing-space-when-dumping-mac.patch
  0004-pre-process-print-macros-containing-and-correctly.patch
  0005-pre-process-don-t-put-spaces-in-macro-parameter-list.patch
  0006-pre-process-print-variable-argument-macros-correctly.patch
  0007-pre-process-add-the-dM-option-to-dump-macro-definiti.patch

    These patches implement '-dM' for sparse, just so that I could run:

      $ gcc -dM -E - </dev/null | sort >gcc-macs
      $ ./sparse -dM -E - </dev/null | sort >sp-macs
      $ meld gcc-macs sp-macs
      $ 

    (note you can add -m32, -mx32, -m64 to those gcc/sparse command lines).
    ... in order to help with ...

  0008-pre-processor-add-some-pre-defined-macros.patch

    ... this patch! This patch is not 'finished', but has enough to get
    started with (eg cygwin has a 16-bit wchar_t, etc). For example, on
    cygwin, sparse would spew approx. 1600 warnings on git, without using
    the SPARSE_FLAGS in the config.mak file to set the following:

      $ grep SPARSE_FLAGS config.mak
      #SPARSE_FLAGS += -D__INTPTR_TYPE__='long int'
      #SPARSE_FLAGS += -D__INT32_TYPE__=int
      #SPARSE_FLAGS += -D__INT32_MAX__=2147483647
      #SPARSE_FLAGS += -D__UINT32_TYPE__='unsigned int'
      #SPARSE_FLAGS += -D__UINT32_MAX__=4294967295U
      #SPARSE_FLAGS += -D__INT64_TYPE__='long int'
      #SPARSE_FLAGS += -D__INT64_MAX__=9223372036854775807L
      #SPARSE_FLAGS += -D__UINT64_TYPE__='long unsigned int'
      #SPARSE_FLAGS += -D__UINT64_MAX__=18446744073709551615UL
      #SPARSE_FLAGS += -D__INTMAX_TYPE__='long int'
      #SPARSE_FLAGS += -D__INTMAX_MAX__=9223372036854775807L
      #SPARSE_FLAGS += -D__UINTMAX_TYPE__='long unsigned int'
      #SPARSE_FLAGS += -D__UINTMAX_MAX__=18446744073709551615UL
      #SPARSE_FLAGS += -D__SIZE_TYPE__='long unsigned int'
      #SPARSE_FLAGS += -D__SIZE_MAX__=18446744073709551615UL
      $ 

    After this patch, as you can see, I can comment them out (and remove
    them once this patch lands). Also, the 'selfcheck' used to complain
    about being 'unable to determine type definition of intptr_t' and
    'int32_t'.

  0009-constant-add-Wconstant-size-warning.patch

    This is the RFC patch. The main (but not only) problem with this patch
    is the name of the warning 'constant-size'! ;-) Please take that as
    simply a placeholder for a more appropriate name (whatever that is!).


Ramsay Jones (9):
  sparsec: use a compatible exception model on cygwin
  sparsei: add the --[no-]jit options
  pre-process: suppress trailing space when dumping macros
  pre-process: print macros containing # and ## correctly
  pre-process: don't put spaces in macro parameter list
  pre-process: print variable argument macros correctly
  pre-process: add the -dM option to dump macro definitions
  pre-processor: add some pre-defined macros
  constant: add -Wconstant-size warning

 cgcc                                       |   2 +-
 expression.c                               |   2 +-
 lib.c                                      | 104 +++++++++++++++++++--
 lib.h                                      |   2 +
 pre-process.c                              |  22 ++++-
 sparse.1                                   |  10 ++
 sparsec                                    |  12 ++-
 sparsei                                    |  20 +++-
 validation/backend/sum.c                   |   2 +-
 validation/constant-size-32.c              |  15 +++
 validation/constant-size-64.c              |  15 +++
 validation/preprocessor/dump-macros-only.c |  36 +++++++
 validation/preprocessor/dump-macros.c      |  16 ++++
 13 files changed, 242 insertions(+), 16 deletions(-)
 create mode 100644 validation/constant-size-32.c
 create mode 100644 validation/constant-size-64.c
 create mode 100644 validation/preprocessor/dump-macros-only.c

-- 
2.19.0



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux