warning: int format,pid_t arg (arg 2)

I try following code under Solaris10,like follows:

int glob = 6;
int main(void)
{
  int var;
  pid_t pid;
  var = 88;
  printf("before vfork\n");
  if ((pid = vfork()) < 0) {
    err_sys("vfork error");
  } else if (pid == 0) { 
      glob++;
     var++;
     _exit(0);
  }
  printf("pid = %d, glob = %d, var = %d\n", getpid(), glob, var);
  exit(0);
}

When I compile it,it raise following warning
$gcc -Wall abc.c error.obj
abc.c: In function 'main':
abc.c:16: warning: int format,pid_t arg (arg 2)
ld: warning: symbol 'glob' has differing types:
(file /var/tmp//ccIMPxLe.o type=OBJT; file/usr/lib/libc.so type=FUNC);
/var/tmp//ccIMPxLe.o definition take
ld: warning: symbol 'glob' has differing types:
(file /var/tmp//ccIMPxLe.o type=OBJT; file/usr/lib/libc.so type=FUNC);

Why raise above warning? How to correct it?

Thanks in advance

Because pid's differ widely across systems, the only thing you can really do (aside from changing printf() and adding a new class of object) is to cast intelligently:

printf ("pid = %lu\n", (unsigned long) getpid());

It's a reasonable assumption that a PID is an unsigned integer type.

HTH. YMMV.