Skip to content
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

Select printf format specifier based on OS. #10738

Merged
merged 1 commit into from
May 24, 2023

Conversation

mahge
Copy link
Contributor

@mahge mahge commented May 24, 2023

  • Select the format printf specifier for modelica_integer based on the OS. For Windows this should be defined to "%lld" because modelica_integer is long long int on Windows. For other OSs, it should be "%ld".

  • The generated code can be a little confusing. See discussions in Warnings in .bnd C code #10702 (comment) for how it works and why it is done like this.

Fixes #10702.

  - Select the format printf specifier for modelica_integer based on the
    OS. For Windows this should be defined to "%lld" because modelica_integer
    is long long int on Windows. For other OSs, it should be "%ld".

  - The generated code can be a little confusing. See discussions in
    OpenModelica#10702 (comment)
    for how it works and why it is done like this.
@mahge mahge added COMP/SimRT/C Issues and pull requests related to C simulation runtime. COMP/OMC/Codegen Issue and pull request related to Code generation labels May 24, 2023
@mahge mahge self-assigned this May 24, 2023
@mahge mahge enabled auto-merge (squash) May 24, 2023 15:33
@mahge mahge mentioned this pull request May 24, 2023
@mahge mahge merged commit 17745d2 into OpenModelica:master May 24, 2023
2 checks passed
@mahge mahge deleted the printf_format_specifiers branch May 24, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/OMC/Codegen Issue and pull request related to Code generation COMP/SimRT/C Issues and pull requests related to C simulation runtime.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warnings in .bnd C code
1 participant