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

gcc-bridge and the markdown package #524

Open
perNyfelt opened this issue Dec 27, 2020 · 0 comments
Open

gcc-bridge and the markdown package #524

perNyfelt opened this issue Dec 27, 2020 · 0 comments

Comments

@perNyfelt
Copy link
Contributor

The markdown package (e.g. required by knitr) does not work. When looking into it, it turns out there is some problem with compiling the c code. The compile task "works" in the sense that it completes but when executing the code the following error occurs:
Exception calling rmd_render_markdown : Unsupported pointer store to a memory region allocated for primitives., This means something went wrong during compilation and we allocated the wrong type of storage.

During compilation, the following warning occurs:

Checking wether in Makevars CXX_STD is set to CXX11... no
touch 'markdown.so'
Warning: could not generate code for global variable smartypants_cb_ptrs: org.renjin.gcc.codegen.vptr.VPtrExpr cannot be cast to org.renjin.gcc.codegen.type.fun.FunPtrExpr
Warning: could not generate code for global variable markdown_char_ptrs: org.renjin.gcc.codegen.vptr.VPtrExpr cannot be cast to org.renjin.gcc.codegen.type.fun.FunPtrExpr

The smartypants_cb_ptrs is defines as follows:

static size_t (*smartypants_cb_ptrs[])
	(struct buf *, struct smartypants_data *, uint8_t, const uint8_t *, size_t) =
{
	NULL,					/* 0 */
	smartypants_cb__dash,	/* 1 */
	smartypants_cb__parens,	/* 2 */
	smartypants_cb__squote, /* 3 */
	smartypants_cb__dquote, /* 4 */
	smartypants_cb__amp,	/* 5 */
	smartypants_cb__period,	/* 6 */
	smartypants_cb__number,	/* 7 */
	smartypants_cb__ltag,	/* 8 */
	smartypants_cb__backtick, /* 9 */
	smartypants_cb__escape, /* 10 */
};

Whereas the markdown_char_ptrs is defined as:

static char_trigger markdown_char_ptrs[] = {
	NULL,
	&char_emphasis,
	&char_codespan,
	&char_linebreak,
	&char_link,
	&char_langle_tag,
	&char_escape,
	&char_entity,
	&char_autolink_url,
	&char_autolink_email,
	&char_autolink_www,
	&char_superscript,
	&char_dollar
};

Any ideas of how this might be fixed either by altering the c code or patching some part of the gcc-bridge?

I have forked the markdown project and added a pom.xml and a test to it here: https://github.com/perNyfelt/markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant