Skip to content

Comments

silence warning about missing return and add assert to isError#3079

Merged
yebblies merged 1 commit intodlang:masterfrom
rainers:cleanup_iserror
Jan 10, 2014
Merged

silence warning about missing return and add assert to isError#3079
yebblies merged 1 commit intodlang:masterfrom
rainers:cleanup_iserror

Conversation

@rainers
Copy link
Member

@rainers rainers commented Jan 10, 2014

tiny followup for #3074

@yebblies
Copy link
Contributor

Auto-merge toggled on

yebblies added a commit that referenced this pull request Jan 10, 2014
silence warning about missing return and add assert to isError
@yebblies yebblies merged commit 2318831 into dlang:master Jan 10, 2014
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather we used a function similar to llvm_unreachable which is easy to mark up as __attribute__((noreturn))/__declspec(noreturn).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather we didn't add stuff that doesn't have a translation to D.

Copy link
Contributor

Choose a reason for hiding this comment

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

assert(0, msg) seems like a good D translation of that, because the semantics are actually part of the language there. (Well, actually llvm_unreachable doesn't compile to a trap in release mode, just to the respective equivalent of __builtin_unreachable but that's was not my point here. Anyway, it's a rather minor issue…)

Copy link
Contributor

Choose a reason for hiding this comment

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

There is already an assert(0) here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm never mind. Still, I'd rather not put and more clang/gcc/msvc extensions into the dmd source, eg I had to special case the noreturn attributes on fatal. We're abandoning C++ after all.

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