Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08d1b22

Browse files
author
Michael Meskes
committed
Allow C array definitions to use sizeof().
When parsing C variable definitions ecpg should allow sizeof() operators as array dimensions.
1 parent8ac5e88 commit08d1b22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/interfaces/ecpg/preproc/ecpg.trailer

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,11 @@ Iresult: Iconst{ $$ = $1; }
18651865
| Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); }
18661866
| ecpg_sconst{ $$ = $1; }
18671867
| ColId { $$ = $1; }
1868+
| ColId '(' ColId ')' { if (pg_strcasecmp($1, "sizeof") != 0)
1869+
mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
1870+
else
1871+
$$ = cat_str(4,$1, mm_strdup("("), $3, mm_strdup(")"));
1872+
}
18681873
;
18691874

18701875
execute_rest: /* EMPTY */{ $$ = EMPTY; }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp