Opened 13 years ago

Closed 11 years ago

#1701 closed defect (fixed)

error with Modelica.Utilities.Streams.error

Reported by: mohamed Owned by: Willi Braun
Priority: critical Milestone: 1.9.0
Component: Run-time Version:
Keywords: Cc: mohamed, Lennart Ochel

Description (last modified by Martin Sjölund)

Dear all,

Using the function  Modelica.Utilities.Streams.error in this simple example with OMShell 1.8.1 generates some
errors:

model err
  parameter Real a=1;
  parameter Real b=1;
  Real x;
equation
  x=a+b;
  if (x>1) then
    Modelica.Utilities.Streams.error("\n %% Error (Modelization)\n");
  end if;
end err;
Error: Error building simulator. Buildlog: gcc -I"C:/OpenModelica1.8.1//include/omc"  -O0 -falign-functions -msse2 -mfpmath=sse  -c -o Modelica_Utilities_Streams_error.o Modelica_Utilities_Streams_error.c \\Modelica_Utilities_Streams_error.c:3:1: warning: "MODELICA_ASSERT" redefined \\In file included from C:/OpenModelica1.8.1//include/omc/modelica_string.h:35, \\                 from C:/OpenModelica1.8.1//include/omc/modelica.h:82, \\                 from Modelica_Utilities_Streams_error.h:4, \\                 from Modelica_Utilities_Streams_error.c:1: \\C:/OpenModelica1.8.1//include/omc/openmodelica.h:267:1: warning: this is the location of the previous definition \\Modelica_Utilities_Streams_error.c:4:1: warning: "MODELICA_TERMINATE" redefined \\C:/OpenModelica1.8.1//include/omc/openmodelica.h:270:1: warning: this is the location of the previous definition \\Modelica_Utilities_Streams_error.c: In function 'in_Modelica_Utilities_Streams_error': \\Modelica_Utilities_Streams_error.c:24: error: variable or field 'out' declared void \\Modelica_Utilities_Streams_error.c:27: error: void value not ignored as it ought to be \\mingw32-make: *** [Modelica_Utilities_Streams_error] Error 1  \\

Is something wrong?

Best regards,
mohamed

Change History (4)

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

Fixed the code-generation issue, but not the issue with if-equations

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

Cc: mohamed, → mohamed
Component: Backend
Description: modified (diff)

comment:3 by Martin Sjölund, 11 years ago

Cc: Lennart Ochel added
Component: BackendRun-time
Milestone: 1.9.0
Owner: changed from mohamed to Willi Braun
Status: newassigned

This generates correct code. But the simulation returns success even though the assertions in error are triggered.

comment:4 by Martin Sjölund, 11 years ago

Resolution: fixed
Status: assignedclosed

This is now working fully

Note: See TracTickets for help on using tickets.