-
-
usr/src/uts/common/sys/feature_tests.h (Diff revision 1) Do C++ compilers define _STDC_C99 ?? This doesn't look like should work, unless they do, and if they do that would be surprising.
I'm highly skeptical that this is the right behavior. It doesn't look like it should be harmful, assuming that a C++ compiler declares itself to support C99 and actually supports the restrict keyword.
The bug needs to have a clearer description of what problem you are actually trying to solve here. There are references to multiple compilers, and "fixed behavior", but what is the wrong behavior, and what is the correct behavior?
5855 fix __RESTRICT_KYWD to support the correct keyword with c++
Review Request #36 — Created April 17, 2015 and submitted
Information | |
---|---|
risto3 | |
illumos-gate | |
5855 | |
51b86d3... | |
Reviewers | |
general | |
5855 fix __RESTRICT_KYWD to support the correct keyword with c++
<added 19/04/2015>
I believe the description should reflect now the fact that these are rectifications
to what gnu C does in fix-includes for c++ purposes. This permits the same with
non g++/clang++ compilers such as sunstudio CC.Perhaps:
5855 update posix_spawn[p] with rectified __RESTRICT_KYWD enabling 'restrict' semantics for both C and C++
The gate (on illumos-omnios) builds clean, lint-clean and shadow-compiler clean.
I've tested with both Sun C++ 5.9 SunOS_i386 Patch 124864-12 2009/04/21
and Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21I've also bootstrapped gcc (primarily 4.9.x now without my patch) and it swallows the good version just fine
as expected.[update 2/07/2015]
I was mistaken, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61649 still needs to commit otherwise the
#ifdef __cplusplus
...
clause is doubled causing warnings, so I've asked again for a commit of the patches provided to gcc.
- 1
- 0
- 1
- 1
- 3
Description | From | Last Updated |
---|---|---|
Do C++ compilers define _STDC_C99 ?? This doesn't look like should work, unless they do, and if they do that ... |
|
Change Summary:
This update applies what gcc fixincludes does and what NetBSD did for the spawn.h header
and equivalent in the implementation. Clean builds and all, testing the same.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+13 -9) |
Description: |
|
---|
Testing Done: |
|
---|
Change Summary:
Update with a workaround avoiding any upstream gcc fixincludes
as well as updating as appropriate the comment text.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+19 -13) |
-
-
usr/src/uts/common/sys/feature_tests.h (Diff revision 3) I'd remove the space between # and define - to be consistent.
-
-
usr/src/uts/common/sys/feature_tests.h (Diff revision 3) Oh, I see... I thought that was talking about the presence of the #define not the specific whitespacing. Since the whitespace is important, I think it wouldn't be the worst thing to make the comment more... eye catching. How about moving that sentence closer to the strange looking #define? E.g.,
... #else /* * NOTE: The whitespace between the # and define is significant. It foils gcc's fixincludes from defining a dedundant 'restrict'. */ * /* CSTYLED */ # define _RESTRICT_KYWD restrict #endif
Change Summary:
update to comments per Josef's suggestion
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+22 -13) |