Running scan-build on multiple source files

I have two source files each of which is analyzed independently
without error by scan-build. However, the combination of the 2 files
should trigger a complaint from scan-build, assuming scan-build has
inter-procedural analysis spanning the two compilation units.
However, scan-build is silent. Is this beyond the capabilities of
scan-build, or am I invoking the tool incorrectly?
(If I concatenate the source for the two files into a single file,
then scan-build finds the expected error.)

Here's how I invoke scan-build:
  scan-build gcc a.c b.c

where a.c contains:

#include <stdio.h>
extern int b (int i);
int main (int argc, const char **argv)
{
  int i;
  for (i = 0; i < 10; i++) {
    printf ("i=%d ratio=%d\n", i, i/ b(i)); // Note zero divide here
  }
  return 0;
}

and b.c contains the identity function:
int b (int i) { return i; }

I have two source files each of which is analyzed independently
without error by scan-build. However, the combination of the 2 files
should trigger a complaint from scan-build, assuming scan-build has
inter-procedural analysis spanning the two compilation units.

That assumption would be incorrect. The Clang Static Analyzer has no cross-TU power at the moment.

Right. scan-build’s job is simply to find out which files you want to compile (more useful when you have a build system rather than a single explicit build command). Analysis is still done on each TU separately.

Sorry!
Jordan

I look forward to the day when there's a program library of some kind!
That's a big effort, I know, having worked on one for the Cray MTA
compiler.