Skip to content

OG_COUNTED_BY issue on Linux with Swift 6.1 compiler #130

@Kyle-Ye

Description

@Kyle-Ye

It can be compiled with Swift 6.0 but not with Swift 6.1.

The error message is

In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/Attribute/AttributeID.cpp:8:
In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/Attribute/AttributeID.hpp:12:
In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGAttribute.h:12:
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGGraph.h:108:70: error: use of undeclared identifier 'count'; did you mean 'round'?
  108 | bool OGGraphAnyInputsChanged(const OGAttribute *inputs OG_COUNTED_BY(count), size_t count);
      |                                                                      ^~~~~
      |                                                                      round
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGBase.h:54:39: note: expanded from macro 'OG_COUNTED_BY'
   54 | #define OG_COUNTED_BY(N) __counted_by(N)
      |                                       ^
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGBase.h:48:55: note: expanded from macro '__counted_by'
   48 | #define __counted_by(N) __attribute__((__counted_by__(N)))
      |                                                       ^
/usr/lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/math.h:107:12: note: 'round' declared here
  107 | using std::round;
      |            ^
In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/Attribute/AttributeID.cpp:8:
In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/Attribute/AttributeID.hpp:12:
In file included from <redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGAttribute.h:12:
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGGraph.h:108:56: warning: '__counted_by__' attribute ignored [-Wignored-attributes]
  108 | bool OGGraphAnyInputsChanged(const OGAttribute *inputs OG_COUNTED_BY(count), size_t count);
      |                                                        ^
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGBase.h:54:26: note: expanded from macro 'OG_COUNTED_BY'
   54 | #define OG_COUNTED_BY(N) __counted_by(N)
      |                          ^
<redacted>/OpenGraph/Sources/OpenGraph_SPI/include/OGBase.h:48:40: note: expanded from macro '__counted_by'
   48 | #define __counted_by(N) __attribute__((__counted_by__(N)))
      |                                        ^
1 warning and 1 error generated.
error: fatalError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions