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

Odd phrasing makes C library dependent on C++ #470

Open
potswa opened this issue Apr 6, 2015 · 9 comments
Open

Odd phrasing makes C library dependent on C++ #470

potswa opened this issue Apr 6, 2015 · 9 comments
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@potswa
Copy link

potswa commented Apr 6, 2015

[res.on.headers] §17.6.5.2/3 uses "shall" where the intent seems to be "may." It suggests that <math.h> must include <cmath>.

@jwakely
Copy link
Member

jwakely commented Apr 6, 2015

No, the intent is to say the C headers don't include anything else, i.e. <stdlib.h> doesn't include <vector>. Changing that to "may" would weaken that.

This doesn't seem editorial anyway.

@potswa
Copy link
Author

potswa commented Apr 9, 2015

The intent is clear to me, but not to at least one StackOverflow user. It says "shall include only," but the intent is not to require that anything be included, which "shall" certainly does. The word "may" gives permission, which is the intent.

Good phrases here would be "may only include" or "shall not include any C++ header besides the corresponding one." If it's really not editorial, I can file a DR, but this is a much easier way to deal with a very small erratum.

@jwakely
Copy link
Member

jwakely commented Apr 9, 2015

Maybe that wording should have been adjusted by http://cplusplus.github.io/LWG/lwg-defects.html#456

@potswa
Copy link
Author

potswa commented Apr 9, 2015

Yes, the current phrasing does make sense within the model described as a problem, but not with the resolution. What's the next step?

@jensmaurer
Copy link
Member

Suggestion: "The C standard library headers (D.4) shall not include C++ standard library headers other than their corresponding C ++ standard library header, as described in 17.6.1.2."

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 13, 2016

Note also that we have exhaustive synopses of the cname headers now, so we do kind of tell you what we expect to be in those headers.

@jensmaurer
Copy link
Member

jensmaurer commented Nov 13, 2016

The issue is still that we need to prohibit C headers from including C++ headers. We don't want <stddef.h> to make std::vector available, ever.

@zygoloid
Copy link
Member

zygoloid commented Mar 3, 2017

How can we prevent that, given that is permitted to include ? Seems like an LWG issue to me.

@zygoloid zygoloid added the lwg Issue must be reviewed by LWG. label Mar 3, 2017
@jwakely
Copy link
Member

jwakely commented Mar 3, 2017

Agreed, I think this should be dealt with as a DR.

@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

No branches or pull requests

5 participants