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

Mandelbrot JitBuilder example should output ASCII encoded PPM header on z/OS via the port library #4901

Open
fjeremic opened this issue Mar 5, 2020 · 1 comment

Comments

@fjeremic
Copy link
Contributor

fjeremic commented Mar 5, 2020

The Mandelbrot JitBuilder sample [1] currently uses fprintf to encode the PPM header on z/OS. This is problematic because literal strings on z/OS are encoded as EBCDIC, and this we end up with an invalid PPM header which renders the image invalid when attempting to view.

We should use the port library to encode this string as ASCII in a portable way on all platforms.

[1] https://github.com/eclipse/omr/blob/6328141a215e35978ebed7dad1e9ba73cca4484f/jitbuilder/release/cpp/samples/Mandelbrot.cpp#L343

@mstoodle
Copy link
Contributor

mstoodle commented Mar 5, 2020

Note that this file (Mandelbrot.cpp) is not really built against the full OMR project, though I agree in principle with using the port library as an attractive way to address the problem. The code samples are meant to stand by themselves (with the unfortunate side effect you discovered for this particular sample).

Other options could be to have a zOS specific version of this particular sample, or to just to include the appropriate #ifdef'd code into the code sample. The second is probably preferable, but I'm open to other solutions / positions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants