mirror of
https://github.com/google/brotli.git
synced 2026-09-22 14:45:51 +00:00
C++ compilation fails without -fpermissive #262
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @very-cool-name on GitHub (Nov 23, 2018).
Hello! Is there a specific reason why this character array implemented with explicit '\0' in the end?
5805f99a53/c/common/transform.c (L14)It fails to compile on C++ compiler with error:
error: initializer-string for array of chars is too long [-fpermissive]Is it possible to write it without specifying size? I.e. :
static const char kPrefixSuffix[] = "...."I've looked at disassembled code https://godbolt.org/z/cwc5Xi and don't see much difference, except copying from register.
@very-cool-name commented on GitHub (Nov 26, 2018):
Or if for some reason number 217 is necessary, you can use array initialization:
static const char kPrefixSuffix[217] = {'\1', ' ', '\2', ',', ' ', ...}tedious, but you have to write it only once.
@eustas commented on GitHub (Feb 18, 2019):
Luckily, the last character is
\0. We can just remove it... Will fix very soon.@eustas commented on GitHub (Apr 12, 2019):
Will be fixed with #749