Skip to content

Commit

Permalink
initializer paren-string {("str")} is a C99ism
Browse files Browse the repository at this point in the history
First, `"str"` is a string constant but `("str")` is not.  It is a
random expression whose type happen to be const char*.  Second,
non-constant initializer element is forbidden in C90.  Mixture of
these two results in the fact that `{("str")}` is a C99ism.

Just delete the parens and everything goes well.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Jan 2, 2018
1 parent dfb24be commit b8f8c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion regenc.h
Expand Up @@ -122,7 +122,7 @@ typedef struct {
} PosixBracketEntryType;

#define POSIX_BRACKET_ENTRY_INIT(name, ctype) \
{(short int )(sizeof(name) - 1), (name), (ctype)}
{(short int )(sizeof(name) - 1), name, (ctype)}

#ifndef numberof
# define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
Expand Down

0 comments on commit b8f8c20

Please sign in to comment.