New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make C-code in ModelicaMatIO.c C89 compliant #1258
Comments
Comment by jmattsson on 23 Aug 2013 13:52 UTC |
Comment by dietmarw on 6 Dec 2013 15:43 UTC |
Comment by anonymous on 11 Dec 2013 11:48 UTC |
Comment by jmattsson on 11 Dec 2013 12:28 UTC |
Comment by beutlich on 6 Feb 2014 09:17 UTC |
Comment by jmattsson on 6 Feb 2014 10:28 UTC
We get the errors:
Paths in both gcc command and errors have been shortened to make it easier to read. |
Comment by beutlich on 6 Feb 2014 10:49 UTC |
Comment by jmattsson on 6 Feb 2014 11:17 UTC
Note that was when compiling *without* |
Comment by beutlich on 6 Feb 2014 11:55 UTC |
Comment by beutlich on 6 Feb 2014 11:57 UTC |
Modified by beutlich on 6 Oct 2015 09:23 UTC |
Changelog modified by beutlich on 6 Oct 2015 09:23 UTC |
Comment by beutlich on 15 Jan 2016 08:35 UTC
Defining _GNU_SOURCE to 1 helped to get rid of this warning again. Is this OK for you? If not, I might switch to tmpnam (instead of mktemp) again. |
Comment by jmattsson on 15 Jan 2016 10:38 UTC
OK for us. |
Comment by sjoelund.se on 15 Jan 2016 10:45 UTC
The reason is that there is a race condition after you get the temporary name and open the file (tmpnam might return the same name again). |
Comment by beutlich on 15 Jan 2016 13:25 UTC |
Reported by jmattsson on 23 Aug 2013 13:45 UTC
ModelicaMatIO.c uses the macros
va_copy
andstrdup
which are not a part of the C89 standard. In order to make the code as portable as possible, the code should be changed to be C89 compliant.There are code already that is supposed to be active when those functions are not available, all that is needed is to activate it for C89 mode.
Migrated-From: https://trac.modelica.org/Modelica/ticket/1258
The text was updated successfully, but these errors were encountered: