-
Bug
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
It is sometimes possible for jextract to be fooled by escape characters in strings - this is especially visible in macros which contains escape chars:
$ cat foo.h
#define STR "a\n"
$ jextract --source foo.h
$ javac --add-modules jdk.incubator.foreign foo_h.java
warning: using incubating module(s): jdk.incubator.foreign
./foo_h$constants$0.java:14: error: unclosed string literal
static final MemorySegment STR$SEGMENT_CONSTANT_ = CLinker.toCString("a
^
./foo_h$constants$0.java:15: error: unclosed string literal
");
^
2 errors
1 warning
$ cat foo.h
#define STR "a\n"
$ jextract --source foo.h
$ javac --add-modules jdk.incubator.foreign foo_h.java
warning: using incubating module(s): jdk.incubator.foreign
./foo_h$constants$0.java:14: error: unclosed string literal
static final MemorySegment STR$SEGMENT_CONSTANT_ = CLinker.toCString("a
^
./foo_h$constants$0.java:15: error: unclosed string literal
");
^
2 errors
1 warning