Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmake/SC_Targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ macro(SC_ADDEXEC execname)
message(SEND_ERROR "SC_ADDEXEC usage error - expected STATIC LINK_LIBRARIES targets (${_lib})")
endif()
endif()
# Executables consume their dependencies but do not publish an
# interface to downstream targets.
target_link_libraries(${execname} PRIVATE ${_lib})
endforeach()
target_link_libraries(${execname} PRIVATE ${${_arg_prefix}_LINK_LIBRARIES})
endif()
Expand Down Expand Up @@ -74,6 +77,11 @@ macro(SC_ADDLIB _addlib_target)
message(SEND_ERROR "SC_ADDLIB usage error - expected (static) LINK_LIBRARIES targets (${_lib})")
endif()
endif()
# Schema libraries are consumed directly by generated test programs.
# Publish their link requirements explicitly; the legacy unscoped
# signature does not reliably provide a transitive interface with
# current CMake versions.
target_link_libraries(${_addlib_target} PUBLIC ${_lib})
endforeach()
target_link_libraries(${_addlib_target} ${_lib})
endif()
Expand All @@ -93,4 +101,3 @@ endmacro()
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8

21 changes: 21 additions & 0 deletions src/express/expparse.y
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
/** Lemon grammar for Express parser, based on SCL's expparse.y. */
%include {
#include <assert.h>
#include <stdlib.h>
#include "token_type.h"
#include "parse_data.h"

/* Wrapper functions for modern lemon compatibility
* Modern lemon from starseeker/lemon uses a 3-parameter signature for memory
* allocation functions: void* realloc(void*, size_t, void*) and void free(void*, void*)
* The third parameter is a context pointer for custom allocators.
* These wrappers adapt the standard C library malloc/free/realloc to this signature
* by ignoring the context parameter. Error handling (NULL checks) is performed by
* the generated lemon code, not in these wrappers.
*/
static void *exp_realloc(void *ptr, size_t size, void *ctx) {
(void)ctx; /* unused - no custom allocator context needed */
return realloc(ptr, size);
}

static void exp_free(void *ptr, void *ctx) {
(void)ctx; /* unused - no custom allocator context needed */
free(ptr);
}

int yyerrstatus = 0;
#define yyerrok (yyerrstatus = 0)

Expand Down Expand Up @@ -120,6 +139,8 @@ void parserInitState( void )
} /* include */

%extra_argument { parse_data_t parseData }
%realloc exp_realloc
%free exp_free

%destructor statement_list {
if (parseData.scanner == NULL) {
Expand Down
Loading