gemrb icon indicating copy to clipboard operation
gemrb copied to clipboard

Investigate behavior of `__GNUC__` macro

Open czarny247 opened this issue 1 year ago • 1 comments

Assumptions:

  • It's not clear if __GNUC__ is defined if you disable GNU extensions even if your compiler supports it. maybe we should open an issue to figure out what we really ought to be doing for these checks.

  • It is not defined for Clang if it is set up for MSVC (Windows)

Originally posted by @bradallred in https://github.com/gemrb/gemrb/pull/1969#discussion_r1433162057

czarny247 avatar Dec 21 '23 15:12 czarny247

If we want to avoid using it, it's as simple as adding 5 more cmake tests for compiler features. Namely:

  • __attribute__ ((deprecated
  • __attribute__ ((visibility
  • __attribute__ ((warn_unused_result))
  • __attribute__ ((sentinel))
  • __attribute__ ((unused))

lynxlynxlynx avatar Dec 21 '23 15:12 lynxlynxlynx