Best guess with all the elision: pid_t is undefined. You need both
#include <sys/types.h>
#include <unistd.h>
Otherwise you don't get what you think you're getting.
It would have been more helpful to provide the smallest source file that failed in the same way. For instance, the following (a minimal elaboration of your text) doesn't generate the warning you describe for me on the first system I tried.
#include <unistd.h>
#include <stdio.h>
int main() {
pid_t pid, pgid;
if((pgid = getpgid(pid)) < 0) {
puts("Oops.");
}
return 0;
}
The reason reduction to a minimal failing case is important:
1. Ensures that you have adequately isolated the problem. Frequently this step makes the cause evident. It also helps eliminate false leads.
2. Ensures that others can recreate your difficulty and thereby diagnose it.
Frequently, the exercise of preparing to explain a problem clearly to someone who is unfamiliar with your project causes the source of the problem to leap out.