Skip to content

sparse on MinGW

Ramsay Jones linux-sparse 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Add the __restrict__ keywordident-list.h parse.c validation/reserved.c+4 -21 reply
2/5Add support for the MinGW platformcgcc+13 -04 replies
3/5Fix some "unknown format" warningscompile-i386.c example.c expand.c +6 more+43 -236 replies
4/5test-suite: Add -b option to ignore CR at eol on MinGWvalidation/test-suite+1 -14 replies
5/5lib.c: Add __sync_lock_test_and_set as a builtin functionlib.c+1 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] sparse on MinGW

Hi Chris,

As I mentioned before, I ported sparse to MinGW four years ago, but have not posted the patches here yet because they need some "tidy up" work.

Well, I still haven't done the tidy-up, but I have decided to post them anyway! :-D

Actually, only the first four patches are really about porting to MinGW; the final patch just happens to fix a problem while running sparse over git on MinGW (compat/nedmalloc/nedmalloc.c to be precise).

Patch #1 adds the __restrict__ keyword, which is used often in the system headers.

Patch #2 actually adds support for MinGW to cgcc. Note that this only adds support for 32-bit systems. I don't have access to a 64-bit system, but I suspect this would require additional changes to support 64-bit.

Patch #3 fixes all of the compilation errors/warnings. This is mostly fixing up "format specifiers" (e.g. "%llx") which gcc on MinGW does not understand. Fixing the format specifiers involves using the macros in the <inttypes.h> header file. However, this patch addresses other issues, which are mostly marked by the use of "#if !defined(__MINGW32__)" conditional blocks, and is the reason for not submitting earlier.

Patch #4 allows the test-suite to run on MinGW. [The original version of these patches actually used calls to _setmode() to set _O_BINARY mode for stdout and stderr so that sparse output used LF line endings, rather than CRLF.]

ATB,
Ramsay Jones

Ramsay Jones (5):
Add the __restrict__ keyword
Add support for the MinGW platform
Fix some "unknown format" warnings
test-suite: Add -b option to ignore CR at eol on MinGW lib.c: Add __sync_lock_test_and_set as a builtin function

 cgcc                  | 13 +++++++++++++
 compile-i386.c        |  7 ++++---
 example.c             |  7 ++++---
 expand.c              |  5 +++--
 ident-list.h          |  2 +-
 lib.c                 |  1 +
 linearize.c           | 15 ++++++++++-----
 parse.c               |  6 ++++--
 pre-process.c         |  7 ++++++-
 show-parse.c          | 15 ++++++++++-----
 sparse.c              |  3 ++-
 tokenize.c            |  4 ++--
 validation/reserved.c |  1 +
 validation/test-suite |  2 +-
 14 files changed, 62 insertions(+), 26 deletions(-)
Signature · 1 line
1.8.2