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

Appearance settings

Commit 08d1b22

Browse filesBrowse 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 parent 8ac5e88 commit 08d1b22
Copy full SHA for 08d1b22

File tree

1 file changed

+5
-0
lines changed
Filter options

1 file changed

+5
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/interfaces/ecpg/preproc/ecpg.trailer
+5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.