Reported on Ubuntu 26.04: GCC 15 makes -Wincompatible-pointer-types an
error, so lib/libaubit4gl/curl.c no longer compiled where libcurl is
installed. It only ever built by accident - GCC 13 warned and carried on.
- incl/a4gl_curl.h: the local file in struct fcurl_data was a FILE *, but
curl.c opens and reads it through the A4GL_gz* macros, which are the
zlib functions (working on a gzFile) whenever zlib is enabled. The union
member now follows A4GL_gzPtr, falling back to FILE * if the header is
used without a4gl_libaubit4gl.h.
- incl/a4gl_libaubit4gl.h: A4GL_gzftell/gzfseek/gzrewind existed only in
the no-zlib branch, which is why curl.c had to call gzrewind() directly
and broke the no-zlib build in the other direction. Added the zlib
versions; corrected the no-zlib A4GL_gzftell/gzfseek from tell()/seek()
to ftell()/fseek().
- lib/libaubit4gl/curl.c: gzrewind() -> A4GL_gzrewind().
The generated API_*_self.c files (dlmagic -S, used by the static-link
targets - 4glc compiles API_parse_self.c, mkglobals and fglreload_static
compile API_lex_self.o) called the <LIB_PREFIX> functions with no
prototypes in scope: 47 implicit declarations, all fatal under GCC 15.
The prototypes were always there - dlmagic -H writes them to
a4gl_API_<x>_lib.h - but only API_parse_int.h happened to include it.
- lib/bin/dlmagic, lib/bin/dlmagic_c.awk: self mode now includes the
_lib.h holding the prototypes of what it calls, and both modes include
a4gl_API_<x>.h, declaring what they define. Self mode no longer emits
the dlopen-only declarations (clrcachedptrs, declared static but never
defined; dlclose; the unused currentLib). A MAP entry or a "..."
parameter makes the wrapper call internal_<fname>/the mapped name, which
no header declares - unused today, so the generator now emits a matching
prototype rather than leaving a trap.
- lib/libaubit4gl/Makefile: a4gl_API_%_lib.h needs a rule of its own now
that it is a prerequisite rather than a side effect of the .h rule, and
needs naming as a target (API_LIB_HEADERS, .PRECIOUS) so make does not
delete all 11 headers as intermediate files. $^ -> $< in the _self.c
recipe, or the added prerequisite is passed to dlmagic as <APIName>.
Also fixes parallel builds of the API layer, which never worked: dlmagic
assembled its output in dlm.1/header.dlmagic/clrptr.dlmagic in the current
directory, so concurrent runs overwrote each other and make -j failed.
The scratch files are now named after the pid.
All 26 generated API files (11 dlopen + 11 self, plus 4 in compilers/4glc)
now compile with no errors and no warnings under -Wall -Wextra
-Wredundant-decls -Wmissing-declarations -Wmissing-prototypes
-Wstrict-prototypes and the GCC 15 -Werror set.