Opened 10 years ago

Closed 10 years ago

#3166 closed defect (fixed)

Treatment of multiline strings with DOS line endings

Reported by: Rüdiger Franke Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.2
Component: Code Generation Version: trunk
Keywords: Cc:

Description

The following model contains a multiline doc string:

within ;
model MultiLineEncodingDOS "This is a doc string
  with embedded DOS line ending"
  Modelica.Blocks.Interfaces.RealInput Pin(start=2.7076e6);
  Modelica.Blocks.Interfaces.RealOutput Pout;
equation
  connect(Pin, Pout);
end MultiLineEncodingDOS;

Saving it with DOS line endings (see attached MultiLineEncodingDOS.mo) and opening it under Linux, the parser keeps the DOS line ending in the multiline doc string. This causes C compiler errors later on -- OMEdit (r24644) FMI --> Export FMU raises the error:

[1] 06:02:02 Translation Error
Error building simulator. Build log: clang -fPIC -O0 -march=native -I"/usr/include/omc/c" -I"/usr/include/omc/c/fmi2" -I. -c -o MultiLineEncodingDOS_FMU.o MultiLineEncodingDOS_FMU.c clang -fPIC -O0 -march=native -I"/usr/include/omc/c" -I"/usr/include/omc/c/fmi2" -I. -c -o MultiLineEncodingDOS.o MultiLineEncodingDOS.c In file included from MultiLineEncodingDOS.c:227: ./MultiLineEncodingDOS_init.c:1:1: warning: missing terminating '"' character [-Winvalid-pp-token] "\n\n\n: recipe for target 'MultiLineEncodingDOS.o' failed make: *** [MultiLineEncodingDOS.o] Error 1 

See also ticket:3151#comment:4

Attachments (1)

MultilineEncodingDOS.mo (262 bytes ) - added by anonymous 10 years ago.

Download all attachments as: .zip

Change History (3)

by anonymous, 10 years ago

Attachment: MultilineEncodingDOS.mo added

comment:1 by Martin Sjölund, 10 years ago

Status: newaccepted

comment:2 by Martin Sjölund, 10 years ago

Component: ParserCode Generation
Resolution: fixed
Status: acceptedclosed

Fixed in r24645.

Note: See TracTickets for help on using tickets.