Opened 9 years ago
Closed 9 years ago
#3403 closed defect (fixed)
Avoid using "time" as a macro variable
Reported by: | Adrian Pop | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | 1.9.3 |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: |
Description
As far as I can see we define time in Model_model.h
#define time data->localData[0]->timeValue
That has issues if you use things like
srand(time(NULL));
in your external code.
The question is how do we deal with this? What does the spec says?
Change History (7)
comment:1 by , 9 years ago
comment:3 by , 9 years ago
Seems also some models from PNLib are failing with this, i.e.:
https://test.openmodelica.org/libraries/PNlib/files/PNlib.Examples.DisTest.PDtoTD.err
All the new failures here:
https://test.openmodelica.org/hudson/job/PNlib_Compilation/lastCompletedBuild/testReport/
comment:4 by , 9 years ago
I guess include change is to blame:
https://github.com/OpenModelica/OMCompiler/commit/a892206ef9ee7fe7a6ba76d4718ed8b7f81a54a8#diff-bdfba08e5cc5c00a8418dc020d86516bR4937
comment:6 by , 9 years ago
Milestone: | Future → 1.9.3 |
---|---|
Owner: | changed from | to
Status: | new → accepted |
Summary: | Defining "time" variable clashes with use of function time(...) in external code → Avoid using "time" as a macro variable |
comment:7 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
As this library did not change then it means that some of the changes from yesterday are to blame, probably some changes in the order of includes.