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

[SR-7165] Excise <iostream> from the Reflection libraries #49713

Closed
belkadan opened this issue Mar 10, 2018 · 6 comments
Closed

[SR-7165] Excise <iostream> from the Reflection libraries #49713

belkadan opened this issue Mar 10, 2018 · 6 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. good first issue Good for newcomers reflection standard library Area: Standard library umbrella

Comments

@belkadan
Copy link
Contributor

Previous ID SR-7165
Radar None
Original Reporter @belkadan
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Bug, Reflection, StarterBug
Assignee ismetanin (JIRA)
Priority Medium

md5: 50c360f85ba6b0b2290c6133b7260217

relates to:

Issue Description:

From the LLVM Coding Standards:

The use of #include <iostream> in library files is hereby forbidden, because many common implementations transparently inject a static constructor into every translation unit that includes it.

Note that using the other stream headers (<sstream> for example) is not problematic in this regard — just <iostream>.

We should get this out of stdlib/public/Reflection/TypeLowering.cpp and include/swift/Reflection/*, and replace it with whatever we actually need in that file for streaming. (The headers might be able to get away with <iosfwd>.)

tools/swift-reflection-dump/swift-reflection-dump.cpp also uses it, but that's a testing tool that is going to use the standard streams, so that's more okay.

@jckarter
Copy link
Member

Even `iosfwd` would preferably be avoided. We shouldn't have any API that relies on iostream, so whatever it's using iostreams for internally (number formatting and string concatenation most likely) ought to be replaceable with other mechanisms.

@swift-ci
Copy link
Collaborator

Comment by Fumiya Nakamura (JIRA)

I'll take a look at this.

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 2, 2018

Comment by Fumiya Nakamura (JIRA)

I created PR! #15677

@belkadan
Copy link
Contributor Author

Oops. It looks like the reviewers (including me) dropped the ball on this one and now the patch doesn't apply.

Resetting assignee on all Starter Bugs last modified in 2018. If someone wants to pick up nakamurafumiya003@gmail.com (JIRA User)'s work, or to start from scratch, they're welcome to.

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 8, 2019

Comment by Ivan Smetanin (JIRA)

Took this and created PR: #27081

@swift-ci
Copy link
Collaborator

Comment by Ivan Smetanin (JIRA)

Resolved in: #27081

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. good first issue Good for newcomers reflection standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants