bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quotearg: shell escape issue with single quote


From: Pádraig Brady
Subject: Re: quotearg: shell escape issue with single quote
Date: Wed, 3 Apr 2024 23:21:55 +0100
User-agent: Mozilla Thunderbird

On 03/04/2024 22:33, Bruno Haible wrote:
Hi Pádraig,

The attached should fix this issue.

   process_input:
+  bool pending_shell_escape_end = false;

It has a syntax error: With clang and with GCC versions < 11, it is invalid
to put a declaration after a label. See:

=================== foo.c =================
int main ()
{
   goto label;

  label:
   int ret = 0;
   return ret;
}
===========================================
$ gcc -c foo.c
foo.c: In function ‘main’:
foo.c:6:3: error: a label can only be part of a statement and a declaration is 
not a statement
     6 |   int ret = 0;
       |   ^~~
$ clang -c foo.c
foo.c:6:3: error: expected expression
     6 |   int ret = 0;
       |   ^
foo.c:7:10: error: use of undeclared identifier 'ret'
     7 |   return ret;
       |          ^
2 errors generated.

The workaround is trivial: Add a semicolon after the colon:

    process_input: ;
     bool pending_shell_escape_end = false;

Oh tricky!

Done and pushed.

thanks for the review,
Pádraig




reply via email to

[Prev in Thread] Current Thread [Next in Thread]