encode-ffi-field - syntax checking for field properties #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch represents a single changeset, developed previously under a local development branch. It's submitted here, from a patch branch under the thinkum-contrib mirror at GitHub
The patch was tested, previously, in October of 2019, under a Debian 10 amd64 installation. I've now tested the ffigen5 build under FreeBSD 12.1. With regards to tooling: Subsequent of a review of the latest port update for CCL, I'd like to create a ccl-devel port under FreeBSD ports and test out ffigen5 under the latter. I believe that a port could serve as a nice context for containing the list of header files to process, for CCL itself and for such as GTK. Pursuant of any tractable success in this, will try to publish the ports patch under a new FreeBSD ports mirror and mention to the CCL mailing list.
I've tested this patch out, only under interactive I/O on the Debian 10 host.
Original changelog message (spell-checked here, syntax updated for Markdown processing)
lib/db-io.lisp: Provide some syntax checking in encode-ffi-field
Under some build configurations, after processing OS header files in
some host environments, ffigen5 may produce field information having
non-positive offset and/or width properties, in some specific fields.
This changeset provides a rudimentary parse-time syntax check for such
data, implemented here in
encode-ffi-field
. On encountering a negativeoffset or width for a field, the type check will signal a continuable
error of type
simple-type-definition-error
. The continuation formwould throw to the symbol,
ignore-type
, with no values.Furthermore, if encountering a zero width for a field, tentatively the
updated
encode-ffi-field
would produce a warning condition of typesimple-type-definition-warning
This also updates the following functions, to gracefully handle the
catch symbol
ignore-type
, such that may be thrown from the updatedencode-ffi-field
The following condition classes are added, each in a tentative
definition, such as to be used in this simple type checking for ffigen
data, in
encode-ffi-field
This patch was originally developed circa October, 2019
The patch has been tested, to a limited extent, under a Debian 10 amd64
installation.
(cherry picked from commit 333a1f8)