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

Fix sarray2.h to build with gcc #22

Closed
wants to merge 3 commits into from
Closed

Conversation

ngrewe
Copy link
Member

@ngrewe ngrewe commented Oct 27, 2016

Hi David,

gcc and clang disagree on to deal with const expressions in static initialisations (bug report here), so the sparse array code currently doesn't compile with gcc. Making data_size and data_mask #defines when not compiling with clang helps.

gcc does not allow arithmetic on const expressions
(see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53091),
make data_size and data_mask #defines if compiling with gcc.
@ngrewe
Copy link
Member Author

ngrewe commented Oct 27, 2016

I've also added gcc to the travis build matrix to catch stuff like that. The tests don't build currently (which is kinda expected). I'm not sure whether I'm interested in sifting through them to see which ones we should be able to run with gcc…

Copy link
Member

@davidchisnall davidchisnall left a comment

Choose a reason for hiding this comment

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

I don't really like this, as it's a work around for a gcc bug and is likely to mean that we carry around code supporting a buggy compiler that can't usefully build the runtime anyway (you need clang for the .m files to get a runtime that works sensibly with ARC)

sarray2.h Outdated
static const uint32_t data_size = 256;
#else
#define data_size 256
Copy link
Member

Choose a reason for hiding this comment

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

Can we at least make this (uint32_t)256?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely.

@ngrewe
Copy link
Member Author

ngrewe commented Oct 27, 2016

I don't really like this, as it's a work around for a gcc bug and is likely to mean that we carry around code supporting a buggy compiler

I don't have any particular interest in gcc as an Objective-C compiler either, but there is case to be made that libobjc2 still works as a drop-in replacement for the gcc runtime.

That being said, I think it would be nice to deprecate gcc support in the 1.9.0 release, together with all the legacy runtime functions -- so that we can eventually remove them?

@davidchisnall
Copy link
Member

I tried building with gcc a few months ago and almost all of the tests fail. I think it's too broken to support.

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

Successfully merging this pull request may close these issues.

None yet

2 participants