[please CC me on replies] Hi Collin,
At 2025-05-19T21:46:08-0700, Collin Funk wrote: > When compiling Groff with GCC/G++ 15.0, I run into this compiler > error: Thanks for checking the build! I don't have an environment quite that fresh set up and handy. [snip stdckdint build failure] > The immediate fix that comes to mind is using 'g++ -std=gnu23', but > there are 2 issues with this: > > 1. gnulib/m4/std-gnu23.m4 has no code for C++ versions, because no > one interested in C++ has contributed it to Autoconf yet. > 2. Bruno told me that the C++ standards are not compatible with each > other, so there would probably be more issues caused by the change > [1]. Also, for groff itself there is third issue: HACKING[A]: [snip] Implementation languages ------------------------ Beyond what is said under "Dependencies" in 'INSTALL.extra', contributors should note that due to the age of the code base, much of the C++ dialect employed by groff components, while standard, is older than C++98--closer to Annotated Reference Manual C++ (Ellis, Stroustrup; Addison-Wesley, 1990). groff implements its own string class and the Standard Template Library is little used. A modest effort is underway to update the code to more idiomatic C++98. Where a C++11 feature promises to be advantageous, it may be annotated in a code comment. [end snip] For the time being, I'm trying to stick to C++98 in groff. I didn't regard use of checked integer arithmetic as conflicting, because gnulib made it available. > I have committed the two attached patches to Gnulib. If the system has > <stdbit.h> and C++ is in use, we just generate <stdbit.h> and include > it. That way these macros will be defined. Cool! I'll be interested to see if this quietens some warnings I see with Solaris 10 and GCC 5. > My assumption here is that if a system is modern enough to have > <stdbit.h> it's C++ compiler supports __builtin_*_overflow. Since I > assume lib/intprops.h is not compatible with C++. This should be true > for GCC and Clang. For MSVC, I will probably have to add C++ > templates... > > [1] https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00176.html Do you think it would be a good idea to backport these fixes to gnulib's stable/2025-01 branch? It would be convenient for me and my lazy habits... Regards, Branden [A] https://git.savannah.gnu.org/cgit/groff.git/tree/HACKING
signature.asc
Description: PGP signature