Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go emit error #306

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ endif()
lcm_option(
LCM_ENABLE_GO
"Build Go utilities, bindings is source distributed"

# Disable until #294 is resolved
FALSE Go)
# GO_FOUND Go)
GO_FOUND Go)

option(LCM_ENABLE_TESTS "Build unit tests" ON)
if(LCM_ENABLE_TESTS)
Expand Down
17 changes: 14 additions & 3 deletions lcmgen/emit_go.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ uint64_t __lcm_recursive_fingerprint(lcmgen_t *lcm, lcm_struct_t *ls,
if (ls_ != NULL) {
fingerprint += __lcm_recursive_fingerprint(lcm, ls_, &fp);
} else {
fprintf(stderr, "Unable to locate fingerprint for member '%s' of '%s'\n",
fprintf(stderr, "Unable to locate fingerprint for member '%s' of '%s'. "
"Are you missing any .lcm files?\n",
lm->membername, ls->structname->shortname);
return 0;
}
Expand Down Expand Up @@ -567,8 +568,18 @@ static unsigned int emit_go_array_loops(FILE *f, lcmgen_t *lcm, lcm_struct_t *ls
map_builtintype_name(lcm_find_member(ls, dim->size)->type->lctypename);

if (slice_emit){
lcm_struct_t *ls_lm = lcm_find_struct(lcm, lm);
uint64_t lm_fingerprint = lcm_get_fingerprint(lcm, ls_lm);
uint64_t lm_fingerprint = 0;
if (!lcm_is_primitive_type(lm->type->lctypename)) {
if (fingerprint != 0) {
lcm_struct_t *ls_lm = lcm_find_struct(lcm, lm);
if (ls_lm == NULL) {
fprintf(stderr, "Unable to locate %s.\n",
lm->membername);
return -1;
}
lm_fingerprint = lcm_get_fingerprint(lcm, ls_lm);
}
}
emit_go_slice_make(f, n + 1, ls->structname->package, lm, n, slicestr->str, size,
lm_fingerprint);
}
Expand Down