Skip to content

v2.1.3

Choose a tag to compare

@mgrossmann mgrossmann released this 04 Oct 09:55
67e5888

mbt is the build tool for C and S/370 assembler projects that target MVS 3.8j: a project's Makefile is two lines, everything else is in project.toml, and compile, assemble, link and package all run on the host with the cc370 toolchain.

2.1.3 is a drop-in update within 2.1.x. It makes the check for writable data in reentrant modules see what it missed before. Tested with cc370 1.2.0 and libc370 2.2.0. From cc370 1.2.0 on, a module whose project declares no attributes is linked with neither RENT nor REUS, so declare them.

Read this first

  • A test declared rent = true that includes mbtcheck.h now fails the build. mbtcheck.h keeps its pass/fail counters in static storage, and statics in headers are now checked. Declare such tests rent = false (tests are not shared between tasks, so nothing is lost).
  • Data in [internal] sources is now reported as a warning whenever any module may be RENT. Before, it was reported only when some other finding existed. Which module links which internal object is not known before the link, so these remain warnings.
  • make module-data MODDATA_ARGS=--all lists every finding; the build shows three warnings per module.

What changed

before (2.1.2) now (2.1.3)
a static in a project header not seen reported against the header, once per module
system headers (the libc370 sysroot) not scanned still not scanned
[internal] data only reported alongside another finding reported whenever a module may be RENT
struct tag { … } __attribute__((aligned(n))); reported as writable data a type definition, not reported
a prototype with a function-pointer parameter, void f(void (*cb)(int)); reported as a pointer variable a prototype, not reported
static char *days[] = { ("Mon"), ("Tue") }; missed (taken for a function) reported

Install

mbt is consumed as a git submodule:

git -C mbt fetch --tags
git -C mbt checkout v2.1.3
git add mbt

Then make module-data to see what the check reports for the project. docs/MIGRATION.md describes rent, reus, refr and the check in full.

Changelog

  • The module-data check scans every non-system header a source includes, and reports each finding once per module (#153).
  • [internal] data is reported whenever any module may be RENT (#153; attributing it to modules through the load map is #152).
  • Parser fixes: GNU __attribute__((…)) is ignored when classifying a declaration; only the first parenthesis decides whether a declarator is a function pointer; a declaration with an initializer is never taken for a function head (#153).