Compiling a 4GL program that calls a4gl_get_ui_mode() fails:
error: implicit declaration of function 'aclfgl_a4gl_get_ui_mode';
did you mean 'aclfgl_a4gl_get_info'? [-Wimplicit-function-declaration]
The function exists (lib/libaubit4gl/fglwrap.c) and is prototyped in
a4gl_libaubit4gl.h - but that is the library include path, and generated code
uses the other one (a4gl_incl_4glhdr.h -> a4gl_incl_4gldef.h), so it never sees
the declaration. Implicit declarations were legal C89 and are an error in gcc
14, so what used to be a warning now stops the compile.
a4gl_get_ui_mode was not alone. Every name in lib/generated/std_funcs.c was
compiled as a call against the generated-code include path: 23 of them are
implemented in lib/libaubit4gl with the usual convention and had no prototype
there. All 23 are declared in a4gl_incl_4gldef.h now, which both paths include,
and the 16 declarations that existed in a4gl_libaubit4gl.h (one of them split
over two lines) are removed so there is a single source of truth, as are four
local prototypes at the top of builtin.c that now duplicate it.
A4GL_endis_fields goes the same way: the generator emits a call to it for the
field controls (print_endis_* in cmds_funcs.c) and it too was declared only in
a4gl_libaubit4gl.h. That is what stopped tools/test/gui/gui.4gl and
hello-gui.4gl from compiling; both do now.
Signatures were checked against the definitions, not against other headers.
Checked on 142 modules from tools/ and the test suite: 110 compile where 108
did, the two gui programs being the difference, and no module that compiled
before fails now. The same holds with MARK_SCOPE set. libaubit4gl builds with
no redundant-declaration warnings.
Not fixed here, found by the same scan and worth a look on their own:
- the DDE family, winexec, winexecwait and fgl_strtosend are listed as
builtins but are defined taking char* arguments, while the compiler emits
aclfgl_<name>(nargs) like every other builtin - so they cannot be called
from 4GL as they stand
- a4gl_dump_screen, a4gl_load_datatype, set_page and the *_rowid_s family are
listed as builtins with no implementation anywhere - a link error if called
- about 20 more A4GL_* functions the generator emits are declared only in
a4gl_libaubit4gl.h; each is the same latent error for whichever statement
emits it (menus, PDF reports, ESQL cursor state)