From 2d532d21f0e3fe3dec1bacc3d3c2db5a10516141 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 2 Jan 2008 11:24:32 +0100 Subject: [PATCH] Use of 'local' in foreach iterator triggers a warning. --- mpsl.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mpsl.y b/mpsl.y index c16a5a0..39a3be6 100644 --- a/mpsl.y +++ b/mpsl.y @@ -77,6 +77,12 @@ static mpdm_t mpsl_x(mpdm_t a1, mpdm_t a2, int sf) } +static void compiler_warning(char * str) +{ + fprintf(stderr, "WARNING: %s.\n", str); +} + + %} %union { @@ -182,7 +188,8 @@ stmt: } | FOREACH '(' LOCAL compsym ',' expr ')' stmt { - /* alias for foreach() */ + compiler_warning("useless use of local in foreach loop"); + $$ = INS1(L"BLKFRAME", INS2(L"MULTI", INS1(L"LOCAL", $4), -- 2.11.4.GIT