mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Page:
C99 Usage Guidelines
Pages
Assumptions JA
Assumptions
C99 Usage Guidelines
CI Servers
CI用Savings Planの購入
Committer How To JA
Committer How To
Developer How To JA
Developer How To
Developers Meeting
Donation
General Maintenance Policy
Git Migration FAQ JA
Home
How To Backport
How To Contribute
How To Maintain RubyCI Servers
How To Manage Redmine
How To Release JA
How To Report JA
How To Report
How To Request Backport
How To Request Features
Machine Instructions Trace with GDB
Node Position Memo JA
Refinements Spec
Release Engineering 2.1
Release Engineering 2.2
Release Engineering 2.3
Release Engineering 2.4
Release Engineering 2.5
Release Engineering 2.6
Release Engineering 2.7
Release Engineering 3.0
Release Engineering 3.1
Release Engineering 3.2
Release Engineering
Ruby 1.8 Branch Policy JA
Ruby 1.8 Branch Policy
Ruby 1.8 Release Plan JA
Ruby 1.8 Release Plan
Security
Server Resources
Versioning Policy
No results
1
C99 Usage Guidelines
Jemma Issroff edited this page 2023-05-30 16:52:34 -04:00
Table of Contents
From Ruby 2.7, we require C compiler to support C99 features that work on environments supported by platform maintainers.
General rules
- C99 features that cannot be built on Travis/AppVeyor/RubyCI are prohibited.
- Ruby 2.7 requires Visual Studio 2013+, which is tested on AppVeyor and RubyCI.
- Ruby 2.7 requires Oracle Developer Studio 12+ or GCC on Solaris 10+, which are tested on RubyCI. (adding 12.4 and/or earlier is pending, but planned)
Known supported features
Here is a list of features that are known to work on both Visual Studio 2013 and Oracle Developer Studio 12.5, confirmed by this c99.c.
This is just for a quick reference to bypass testing on CI, and you do NOT need to update this list to use your favorite C99 feature as long as it works on Travis/AppVeyor/RubyCI.
- // comments
- mixed declarations and code
- designated initializers
- compound literals
- relaxed constraints on aggregate and union initialization
- trailing comma allowed in enum declaration
See also:
Discussions
- stdbool.h seems to have been added in Oracle Solaris Studio 12.3, so we need to use missing/stdbool.h header for Oracle Solaris Studio 12.2 or earlier, which is included in our internal.h. See r66739.
restrict
keyword does not exist on Visual Studio 2013, but__restrict
exists and is used instead.- Switching
va_copy
definition like r62220 was problematic for cross compiling and removed in r62463.- r62191 was initially introduced for old Visual Studio. We may be able to just use
va_copy
with Ruby 2.7's Visual Studio 2013 requirement.
- r62191 was initially introduced for old Visual Studio. We may be able to just use
Known missing features
- Visual Studio 2013
- variable length arrays
_Complex
- snprintf
- some format specifier behaviors:
- size_t length modifier: %z
- infinite/indefinite/NaN conversion of floating point number
C++
According to the header files committed in https://github.com/ruby/ruby/pull/2991,
We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.
Policies
Development
For developers
- Developer How To, Developer How To JA
- How To Contribute
- How To Report, How To Report JA
- How To Request Backport
- How To Request Features
- Developers Meeting
For committers
- Committer How To, Committer How To JA
- Git Migration FAQ JA
- How To Backport
- How To Manage Redmine
- How To Release JA
- How To Maintain RubyCI Servers