URL: <https://savannah.gnu.org/bugs/?64910>
Summary: assert.h should be included _after_ config.h : causes build failure with clang++ on z/OS Group: GNU roff Submitter: fultonm Submitted: Sun 19 Nov 2023 09:11:06 PM UTC Category: General Severity: 3 - Normal Item Group: Build/Installation Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Sun 19 Nov 2023 09:11:06 PM UTC By: mike fulton <fultonm> I have hit a problem trying to build groff 1.23.0. 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 have a directory of patches that worked for z/OS to fix this problem if that is useful: https://github.com/ZOSOpenTools/groffport/tree/bump-groff-version-1.23.0/patches/assertfix Thanks, Mike Fulton _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?64910> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/