[build2] [build2 0.7-a.0] error: unterminated string literal (due to asm statements)

Mueller Tobias (DC-MH/EMF1) tobias.mueller2 at boschrexroth.de
Mon Feb 26 07:01:13 UTC 2018


Hi,

I have a problem with assembler statements in source or header files.
If these asm statements need more than one line build2 reports an "unterminated string literal" error.

Our core library has a lot of these assembler statements over more than on line:
Simple Example (see also attached foo.c):
  asm volatile("e_li   %r0, 0 \n\
                e_li   %r0, 0");

c:\Tools\build2\bin\b
foo.o.i:20:16: error: unterminated string literal
  info: while parsing c{foo}
  info: while applying rule c.compile to update obje{foo}
  info: while applying rule c.link to update _bin\exe{relocatable}
  info: while applying rule alias to update dir{.\}
info: failed to update dir{.\}

See attachment for
- a log file with verbose level 5
- foo.c and foo.h files
- foo.o.i file
- screenshot of strangely marked line in my Notepad++ if foo.o.i file is loaded

If the asm statements are one liners it works:
Examples:
1.  asm volatile("e_li   %r0, 0; e_li   %r0, 0");
2.  asm volatile("e_li   %r0, 0");
     asm volatile("e_li   %r0, 0");

Is there a way to get around that error?

Tobias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20180226/31e9f1b2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unterminated_string_literal.tar.gz
Type: application/x-gzip
Size: 9830 bytes
Desc: unterminated_string_literal.tar.gz
URL: <https://lists.build2.org/archives/users/attachments/20180226/31e9f1b2/attachment.bin>


More information about the users mailing list