Menu

Commit [r13113]  Maximize  Restore  History

Fix tools/adbload under gcc 14

Three errors, all of them things gcc used to warn about and now rejects
(implicit-function-declaration and int-conversion are errors in gcc 14).

1. A4GL_init_session, A4GL_init_session_with_sqltype and A4GL_set_conn
moved from a4gl_sql.h into a4gl_incl_4gldef.h.

The C generator emits calls to all three (compile_c_sql.c, for
CONNECT TO and SET CONNECTION), but a4gl_sql.h is deliberately kept
out of the generated-code include path - it is not copied by a make
install, and a4gl_4gl_callable.h says so. So every generated module
that opens a session got an implicit declaration. Declarations shared
by both include paths belong in a4gl_incl_4gldef.h, which is what
this does; they are removed from a4gl_sql.h rather than duplicated,
so -Wredundant-decls stays quiet on the library path. Signatures
checked against sql_common.c, not against the old header.

A4GL_close_session and A4GL_set_dialect are left where they are -
nothing generates calls to those.

2. adbload.4gl assigned a FILE * straight into a 4GL INTEGER inside a
CODE block. A 4GL INTEGER is a long, so it needs the cast that the
commented-out line right below it already had; readoneline() casts
the value straight back with (FILE *).

Verified by deleting every generated .4ae/.c under tools and compilers -
74 of them - and rebuilding: all regenerate with no errors. Worth
knowing that a plain "make clean" does not remove them, so a tree that
has been built before hides this entirely; it only shows up on a fresh
one, which is why it reached a user first.

mikeaubury 6 days ago

changed /aubit4glsrc/trunk/incl/a4gl_incl_4gldef.h
changed /aubit4glsrc/trunk/incl/a4gl_sql.h
changed /aubit4glsrc/trunk/tools/adbload/adbload.4gl
/aubit4glsrc/trunk/incl/a4gl_incl_4gldef.h Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/incl/a4gl_sql.h Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/tools/adbload/adbload.4gl Diff Switch to side-by-side view
Loading...