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

[all branches] BUILD BREAK: eliminate use of non-ISO-C90 features #604

Closed
wants to merge 1 commit into from

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Sep 23, 2024

The MIPS MSA code contains // comments and the use of an "asm"
directive, neither of which are part of ISO-C90. This removes the //
comments and converts asm to asm, which GCC allows.

The code compiles but maintenance is required; it's not clear it will
work on anything other than one specific compiler/isa combination. It
should be rewritten using intrinsics, not assembler; as it stands it is
a security risk.

Signed-off-by: John Bowler [email protected]

The MIPS MSA code contains // comments and the use of an "asm"
directive, neither of which are part of ISO-C90.  This removes the //
comments and converts asm to __asm__, which GCC allows.

The code compiles but maintenance is required; it's not clear it will
work on anything other than one specific compiler/isa combination.  It
should be rewritten using intrinsics, not assembler; as it stands it is
a security risk.

Signed-off-by: John Bowler <[email protected]>
@jbowler
Copy link
Contributor Author

jbowler commented Sep 23, 2024

Should apply unmodified to libpng16 as well.

@ctruta
Copy link
Member

ctruta commented Sep 23, 2024

Roger that, thank you. FYI, today things didn't work out for me as planned, but the outlook for tomorrow is better.

TO BE CONTINUED.

Copy link
Contributor

@ProgramMax ProgramMax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think LGTM.

I do not have a MIPS machine to confirm this on. But I'm sure GCC on MIPS behaves similarly to GCC on x86 & ARM. And the documentation is clear:

"For the C language, the asm keyword is a GNU extension. When writing C code that can be compiled with -ansi and the -std options that select C dialects without GNU extensions, use asm instead of asm"

@ctruta
Copy link
Member

ctruta commented Sep 25, 2024

Integrated in both libpng16 and libpng18. Thank you.

@ctruta ctruta closed this Sep 25, 2024
@jbowler jbowler deleted the MIPS-non-ISO-C90-code branch September 26, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants