Hi

I have hit a problem trying to build the latest groff.
I am able to successfully build 1.22.4

The issue I am hitting is that there is a `#include <assert.h>` before the
`config.h` file is included.
Unfortunately on z/OS, `assert.h` includes `stdio.h` and the `stdio.h` that
is pulled in is from `lib/stdio.h`. The `stdio.h` references `restrict`
which is properly defined to __restrict__ in `config.h` but it isn't
included yet... This causes a nasty compiler error.

Looking at the preprocessed output for dvi.cpp, we can see:

```
# 1 "src/devices/grodvi/dvi.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 394 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "src/devices/grodvi/dvi.cpp" 2
# 19 "src/devices/grodvi/dvi.cpp"
# 1 "./lib/assert.h" 1
# 23 "./lib/assert.h" 3

# 1 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 1 3

# 40 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 3
# 1 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 1 3
# 40 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 3
extern "C" {
# 2185 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 3
}
# 41 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 2 3
# 1 "./lib/stdio.h" 1 3
# 21 "./lib/stdio.h" 3
# 43 "./lib/stdio.h" 3
```

I confirmed that including `config.h` before the assert.h gave me a clean
compile.

I can imagine a number of ways to 'fix' this. Should `config.h` be included
before assert.h from the cpp file? If so, that's a number of files that
would need to be changed.

Thanks, Mike

Reply via email to