Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Conversation

@WalterBright
Copy link
Member

Having stdout, etc., be a variable means druntime needs to be linked in, meaning they do not work for -betterC. Switching to an enum makes it work.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@dnadlinger
Copy link
Contributor

Doesn't this break &stdin (and compatibility with other runtimes)?

@WalterBright
Copy link
Member Author

WalterBright commented Sep 2, 2017

Doesn't this break &stdin

Given the vagaries of how stdin is implemented in various C implementations (none of them are the same), and code relying on C stdin being an lvalue is not going to be portable anyway. Sometimes the implementations are a function, not a variable, where taking the address won't give what you presumably want.

(and compatibility with other runtimes)?

This one is specific to the Digital Mars C runtime.

Note that this change is necessary to make betterC code able to access stdin at all. In general, core.stdc implementations should try to find ways that do not require linking in druntime.

Copy link
Member

@schveiguy schveiguy left a comment

Choose a reason for hiding this comment

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

I agree with Walter on this, the vagaries of how any C implementation defines the standard FILE * handles should be forwarded without any extra machinery. Portable code shouldn't make any assumptions about how it works, or depend on a druntime abstraction.

@schveiguy
Copy link
Member

ping @CyberShadow any ideas on the doc build failure? They look internal to the build system itself, but I'm not 100% sure.

@wilzbach
Copy link
Contributor

wilzbach commented Sep 6, 2017

They look internal to the build system itself, but I'm not 100% sure.

I think this has been fixed one or two days ago. Unfortunately the only way to rekick DAutoTest is to rebase (unfortunately I can't help here as I'm without a computer atm).

@CyberShadow
Copy link
Member

@schveiguy It's green now so I'm not sure what the error was, but judging from other build failures in the past few days, it was almost certainly due to code.dlang.org being down.

@schveiguy
Copy link
Member

I'm not sure what the error was

This was the failed build: http://dtest.dlang.io/results/209be21a8f62782bb5b8f66edc7f9f8d62e1c439/2b5450cb012263aa23aad9c24f9528adefbba887/

@dlang-bot dlang-bot merged commit 8867c0d into dlang:master Sep 6, 2017
@WalterBright WalterBright deleted the betterC-stdout branch September 15, 2017 07:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants