Menu

SVN-Code Commit Log


Commit Date  
[r13003] by mikeaubury

Silence the two noisiest warning categories: sign-compare loops and unused-but-set

A full build goes from 2066 warnings to 882. The two categories dealt with here
were 1409 of those, and neither was telling us anything.

-Wunused-but-set-variable (303, across 66 files) is switched off in
configure.ac, alongside the -Wno-unused-parameter and -Wno-unused-function that
were already there - same reasoning, they are almost all leftovers from removed
debug and trace code. This needs configure regenerating, hence the change to
the checked-in configure as well.

-Wsign-compare (1106) is NOT switched off, because the category is not uniformly
noise. It splits three ways:

880 for (a=0; a<x.x_len; a++) counter is int, length is u_int
178 if/while comparisons
13 A4GL_assertion() bounds checks
35 other

Only the first group is meaningless: the counter starts at zero, so the signed
comparison is what was meant all along. Those are now cast - 829 rewritten
mechanically from the compiler's own diagnostics and verified by rebuilding,
plus 3 by hand in ace.yacc, screen.yacc and helper_funcs.ec, which the script
skipped because a #line directive makes the reported column unreliable.

The other 226 are left visible on purpose. The assertions are the reason:

A4GL_assertion(u->variable_id >= ...->variables.variables_len, "Invalid VARIABLE ID");

a negative variable_id converts to a huge unsigned here, so the assertion fires
and catches it. Casting the length to int would let a negative index through
into the array access. Anything that hides this category hides that too.

Two of the casts change behaviour, both for the better:

lib/libform/form_generic/formwrite2.c:439
lib/liblex/lex_esqlc/compile_c.c:2927
for (a = 0; a < (int)(len - 1); a++)

With len==0 the old code computed 0-1 as unsigned, so an empty list ran the
loop UINT_MAX times instead of not at all. Both loops mean "all but the last
element", and now they do that.

What is left: format-overflow 159 (sprintf in the yacc grammars, worth a proper
look), unused-variable 64, missing-prototypes 61, unused-const-variable 48,
redundant-decls 48, plus the bison grammar warnings and the ~19 real bug
candidates noted previously.

2026-08-25 12:29:22 Tree
[r13002] by mikeaubury

Fix clean-build breakage from r13001, two latent pointer bugs, and ~700 warnings

r13001 broke "make cleanall && make": having every generated API .c include
a4gl_API_<x>.h assumed the incl/a4gl_API_*.h naming used by lib/libaubit4gl
and compilers/4glc, but lib/liblogical/processor and lib/liblogical/layout_engine
generate a local API_<x>.h instead, so they failed with "a4gl_API_process.h: No
such file or directory".

- lib/bin/dlmagic, lib/bin/dlmagic_c.awk: drop the api_header include again.
The _lib.h include stays - that is the actual fix for the _self.c files, and
-S is only ever used from the two directories that follow that convention.

Two of these are real bugs rather than cosmetics, both dormant until libcurl
and the ODBC headers were actually in play:

- lib/libsql/odbc/sql.c: SQLLEN was #define'd to int, but the bundled
tools/odbctest/incl headers declare SQLBindCol's StrLen_or_Ind parameter as
SQLINTEGER *, which is long * there - the driver was writing 8 bytes into
4 byte indicator fields on any LP64 platform. Define it as SQLINTEGER.
- lib/liblogical/common/a4gl_lle.c: the HAVE_LIBCURL branch calls url_fopen()
and friends without including a4gl_curl.h, and held the handle in a FILE *
rather than a URL_FILE *. Same bug curl.c had, and equally invisible until
libcurl is installed.

Warning cleanup - a full build goes from 2722 to 2022 warnings on the same
files. Every diagnostic that GCC 14/15 turns into a hard error is now gone
(incompatible-pointer-types 11 -> 0, implicit-function-declaration 5 -> 0,
int-conversion, implicit-int and return-mismatch all 0), so the Ubuntu 26.04
build should get through the whole tree rather than stopping at curl.c.

- compilers/xgen/x.yacc: the generated .xo.c/.xi.c loops compared an int
counter against the XDR _len members, which are u_int. Cast, as the
surrounding generated code already does: common/dataio 220 warnings -> 0.
- incl/Makefile-common.in, lib/libsql/odbc/Makefile: build sqlite3odbc.c,
Christian Werner's ODBC driver vendored from upstream, without our warning
set - same reasoning as the rpcgen output in common/dataio. 318 -> 0. The
-Wno- flags in WARN_THIRDPARTY follow -w deliberately: from GCC 14 those
diagnostics are errors, and -w does not switch an error off.
- lib/libsql/esqlc/Makefile, esql.ec: the ifx_hostvar_t descriptors written by
Informix's own esql preprocessor never initialise the trailing "reserved"
member (119 warnings we cannot fix in our source), and sqgetdbs() is exported
by the ESQL/C library but declared in none of the shipped headers. 124 -> 4.
- incl/a4gl_incl_4glhdr.h: LABEL_USED is now __attribute__((unused)), so the
END_BLOCK_n/CONTINUE_BLOCK_n labels in generated 4GL code stop warning. The
original attempt at this was commented out because it said "used", which is
not valid on a label. 58 -> 0 across every compiled .4gl.
- compilers/fcompile/dump_scr.c: default: break; on five switches over enums
where the unhandled values are deliberately ignored. 63 -> 0.
- tools/adbload2/a4gl_dbload_int.h: prototypes for a4gl_dbload_yyparse() and
yywrap().

Still outstanding, all in hand-written code and needing a decision per site:
sign-compare (1106, mostly dump_form.c, compile_c.c and lint.c),
unused-but-set-variable (303), unused-variable (64), missing-prototypes (61).

2026-08-25 11:42:39 Tree
[r13001] by mikeaubury

Fix gzFile/FILE* type error in curl.c and clean up the dlmagic API generator

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.

2026-08-25 11:12:00 Tree
[r13000] by mikeaubury

GCC 14/debian fixups

2026-08-20 15:32:04 Tree
[r12999] by mikeaubury

Fix fresh-checkout build: rpcgen headers are needed without XDR

r12998 gated the RPCGEN_* recipes in common/dataio/Makefile on
USE_RPCGEN=yes, so with no libtirpc they were never run. As well as the
*_xdr.c modules, rpcgen emits form_x.h, which compilers/4glc/rules
includes - nothing to do with XDR - so a fresh checkout failed with:

No rule to make target '../../common/dataio/form_x.h',
needed by 'rules/generated/y.tab.o'

An existing working copy still built, because form_x.h was already
present as an untracked build artifact.

- common/dataio/Makefile: the RPCGEN_* recipes are unconditional again;
only the libXDRPACKER_* targets stay gated on USE_RPCGEN.
- m4/aubit_tools.m4: rpcgen is therefore required for a source build
even with --with-rpc=none. Fail at configure time with a message
naming the package (Debian: rpcsvc-proto) rather than at the obscure
make error above. Only errors when form_x.h is not already present,
so a tarball shipping the generated files still configures.
- configure: regenerated.

Verified on a clean 'svn export' of the tree: ./configure && make now
completes ("Thank you for using Aubit 4gl compiler"), 57 plug-ins built,
no XDR plug-ins (correct without libtirpc), and the LVARCHAR round-trip
tests pass against a live Informix instance using only that build.

2026-08-15 14:48:05 Tree
[r12998] by mikeaubury

More Claude enhancements

2026-08-15 13:14:04 Tree
[r12997] by mikeaubury

Build: drop AH_BOTTOM fallbacks, use standard autoheader semantics

r12996 added an AH_BOTTOM block defining every legacy symbol to 0 when
configure did not probe it, reproducing the pre-2026 header's contract that
EVERY symbol is defined (0 or 1). That contract is what made '#ifdef HAVE_X'
true even where X was 0 -- a defect, not a feature. Aubit code tests these
with '#if HAVE_X', where an undefined symbol already evaluates to 0, so the
fallbacks were unnecessary for all but seven symbols:

- RTLD_LAZY, RTLD_NOW, DL_LAZY, DL_NOW are dlfcn.h system macros, not
configure symbols. Defining them 0 was a redefinition hazard that only
worked because dlfcn.h's own #define won. They now come from the system:
LT_DLLAZY_OR_NOW still resolves to RTLD_LAZY (0x00001) as before.
- CAN_DLOPEN_SELF and NEED_DL_UNDERSCORE are already self-defaulted by
compilers/pcode/runner_calls.c (which carries a comment noting configure
should have set them). The header forced CAN_DLOPEN_SELF to 0; the code's
own default of 1 is correct here and the symbol is never read. Four of
these sites were in vendored libltdl/ltdl.c, which includes its own
config.h and never saw our header.
- HAVE_LIBQRENCODE_ENCODEMASK guarded an inverted test: QRcode_encodeInput()
under '#ifdef ..._ENCODEMASK' and QRcode_encodeMask() in the #else. The
fallback made that #ifdef always true, so the #else was dead -- had
configure ever failed to find QRcode_encodeMask, the code would have
called precisely that missing function. Now guards on the symbol that can
actually be absent. (Untested at runtime: libqrencode is not installed
here, so '#if HAVE_LIBQRENCODE' is 0 and the block does not compile.)

Also: three AC_DEFINEs in m4/aubit_sql.m4 passed an empty description, so
autoheader generated no template for them and they could never have been
defined. The fallback block had been masking that; autoheader now fails
loudly on it. Descriptions added.

configure.ac 831 -> 412 lines; the header template 771 -> 360 lines with 116
#undef entries and no fallbacks.

Verified: fresh checkout + ./configure && make builds clean and produces a
plugin set byte-size identical to the previous build (61/61), as are
libaubit4gl.so.1.6.3 and bin/xgen. runner_calls.c (not part of the default
build) compiles standalone with the dlopen flags resolving as before.
Rebuilt working tree passes all 17 regression checks.

2026-08-12 10:02:29 Tree
[r12996] by mikeaubury

Build: fix clean-checkout build; add UI_JSON to default targets

A fresh checkout could not be built. Four independent gaps:

1. incl/a4gl_incl_config.h was never generated. The 2026 configure.ac
rewrite dropped the AM_CONFIG_HEADER(incl/a4gl_incl_config.h) that the
old configure.in had (and that BUILD_MODERNIZATION/PLAN.md specified);
working trees only built because they still held a stale copy from the
previous build system. Restored via AC_CONFIG_HEADERS. Since $(DEFS) is
not plumbed into incl/Makefile-common, this header is the ONLY route by
which AC_DEFINE results reach C code.

autoheader alone is not sufficient: it emits templates only for probed
symbols and leaves the rest undefined, whereas the historical header
defined every symbol (0 or 1) so '#ifdef HAVE_X' was always true. 89
#ifdef sites depend on that. configure.ac therefore carries an AH_BOTTOM
block supplying 0-defaults for the 137 legacy symbols, so real values are
used where configure probes and the old contract holds everywhere else.

Also restored two checks the rewrite lost: pdflib.h (without it
lib/liblogical/pdf/process/pdf_barcode fails to compile -- its header
declares PDF-typed prototypes unconditionally) and libintl.h. And the
Informix ESQL/C version probe behind HAVE_IFX_IUS, lifted from the old
configure.in (parse 'esql -V' -> 450, define when >= 290); unlike the
old script an unparsable version warns rather than aborting configure.

Verified: all 137 symbols of the previously-used header are present and
the 19 that differ are unreferenced by C code, appear only in string
literals, or sit in dead branches.

2. lib/libui/ui_json/readJsonForm.c was compiled into libUI_JSON.so but
never versioned (committed in r12995), and it includes form_json.xs.h,
generated from form_json.x by xgen -- neither the .x nor a rule for it
existed. form_json.x is now versioned, ui_json/Makefile generates the
header following the common/dataio pattern, and the five xgen outputs
are svn:ignore'd like every other .xs.h in the tree.

3. libUI_JSON.so was not part of the default build: ui_json hung off
core.ui.xml, reachable only via 'make bootstrap'. UI_JSON is now in
ALL_PLUGINS with a rule in lib/Makefile ordered after PACKER_FORMXML and
UI_XML (it links their formjson.o and borrows their headers), plus a
clean target. No new external dependencies -- libjson.c is bundled.

4. node/baseProgs/runProgram.sh lacked svn:executable, so a clean checkout
got it non-executable and setuid_runner's execv() failed with EPERM,
preventing the web pipeline from launching any program.

Verified end to end: fresh checkout + ./configure && make builds clean, 61
plugins, libUI_JSON.so produced by the default target. Rebuilt working tree
passes all 17 regression checks (12 browser e2e, 3 protocol, 2 iarr-probe).

2026-08-12 08:47:18 Tree
[r12995] by mikeaubury

Angular web UI: JSON pipeline server, Angular app, e2e test suite

- lib/libui/ui_json/readJsonForm.c: compiled into libUI_JSON.so but never
versioned; a clean checkout could not link the driver.
- node/server-angular.js + package.json/package-lock.json: the Angular-era
Node backend (socket.io bridge between libUI_JSON and the browser).
- node/Aubit4GLWebAngular: the Angular application source. node_modules,
dist, .angular and build.log are svn:ignore'd -- a fresh checkout needs
'npm install && npx ng build' before the server has anything to serve.
- node/tools: protocol/e2e test harness (protocol-test, browser-e2e and the
capture/construct/update/iarr/addorder probes).
- node/baseProgs: applications.json plus the .4gl/.per sources for the
jsontest1, iarrtest and fcalltest programs. Compiled .4ae/.c/.ao/.json
outputs are left unversioned (regenerated by 4glpc / fcompile -json).

2026-08-11 17:34:50 Tree
[r12994] by mikeaubury

Claude enhanced fixups - fingers crossed...

2026-08-11 17:22:06 Tree
Older >