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

[libpng18] use ISO standard attributes #590

Closed

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Sep 13, 2024

This is based on #589. It replaces the ad-hoc use of compiler specific
attributees by the ISO standard and adjusts the PNG_FUNCTION macro to
work with the ISO standard; function attributes precede function storage
classes.

  • cmake: Remove architecture-specific checks for hardware optimization
  • Full compile time support for target-specific code
  • MIPS support clean-up
  • Use ISO standard attributes

@jbowler jbowler changed the base branch from libpng16 to master September 13, 2024 01:51
@jbowler jbowler changed the title use ISO standard attributes [libpng18] use ISO standard attributes Sep 13, 2024
@jbowler jbowler force-pushed the use-ISO-standard-attributes branch from b5d182d to 8942be9 Compare September 13, 2024 15:14
@jbowler
Copy link
Contributor Author

jbowler commented Sep 13, 2024

Addresses #568 and obsoletes #572 by doing it in a portable way (#572 would have removed support from some compilers in favour of others, this removes some support from compilers which don't keep up to date with the standard but provides support for the current common compilers, gcc clang and vc).

Note that in the current form this completely addresses the original issue; the original /* FALLTHROUGH */ comment is retained however an extra PNG_FALLTHROUGH or (for the apps) FALLTHROUGH statement is inserted at the same place immediately before it. This matches both the ISO-C requirements and the older compiler requirements.

The change also takes advantage of the ISO spec to add what are I hope meaningful messages to the PNG_DEPRECATED usages. Adds PNG_MAYBE_UNUSED for parameters. PNG_USED is still better if it is done correctly (only on the #if path where the thing really is unused) but [[unused]] is easier, particularly where the parameter really is completely unused (C90 does not support omission of the formal parameter in the definition.)

Makes it easy to add [[sequential]] and [[reproducible]] in the future but these are not currently supported by GCC even though the GCC does support modern definitions of constexpr in C++ (i.e. it supports the [[reproducible]] variant, though [[reproducible]] does other things as well.)

@jbowler jbowler changed the base branch from master to libpng18 September 14, 2024 23:57
@jbowler jbowler force-pushed the use-ISO-standard-attributes branch 2 times, most recently from 938b73e to 7088de3 Compare September 15, 2024 15:19
@jbowler jbowler force-pushed the use-ISO-standard-attributes branch 4 times, most recently from f1247f6 to 219f60b Compare September 19, 2024 00:02
@jbowler jbowler force-pushed the use-ISO-standard-attributes branch from 219f60b to fe05aaf Compare September 21, 2024 15:23
@jbowler
Copy link
Contributor Author

jbowler commented Sep 22, 2024

This is development work and depending on the choice of compiler standard to be used may be superfluous, so I've removed it until other more important issues (reported bugs) are resolved and the long term development plan is clear.

@jbowler jbowler closed this Sep 22, 2024
@jbowler jbowler force-pushed the use-ISO-standard-attributes branch from fe05aaf to 626761b Compare September 22, 2024 08:30
@jbowler jbowler deleted the use-ISO-standard-attributes branch September 22, 2024 08:30
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.

1 participant