This is mostly about mentioning that VLAs which are a required part of
C99 conforming implementations (although made optional in the C11
standard) *must* *not* be used in php-src.
This can lead to undefined warnings when building with -Wundef and using
undefined FOO macro in #if condition. Also such code disabling should
not be encouraged exactly.
* [skip ci] Update CODING_STANDARDS for the acronym casing RFC
see https://wiki.php.net/rfc/class-naming-acronyms
* Improve formatting in CODING_STANDARDS.md
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
---------
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
PHP 8 switched to C99, but did not documented that anywhere.
After @derickr rejected a pull request on timelib
(https://github.com/derickr/timelib/pull/141#issuecomment-1386773784)
because my suggested change removed compile-time checks for
fixed-width integer types, pointing out that they are optional in the
C99 standard, @nikic disagreed with using `uint_least8_t` instead
(which is guaranteed to be available), stating that "We already make
extensive use of uint8_t, you can assume it exists"
(https://github.com/php/php-src/pull/10621#pullrequestreview-1304760668).
In order to avoid such confusion in the future, let's document this
architecture requirement.
- Drop irrelevant rule about // comments since PHP is C99 + GNU extensions
- Add rule about strlen() usage for constant string length calculation
- Minor stylistic changes
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
This PR corrects misspellings identified by the check-spelling action.
The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465
The action reports that the changes in this PR would make it happy: jsoref@602417c
Closes GH-6822.