On Thu, Apr 13, 2017 at 5:10 AM, Dmitry V. Levin <l...@altlinux.org> wrote:
>On Wed, Apr 12, 2017 at 09:31:51PM +0800, JingPiao Chen wrote:
>> @@ -198,6 +199,48 @@ qualify_syscall_number(const char *s, struct
number_set *set)
>>   return done;
>>  }
>>
>> +static bool
>> +qualify_syscall_regex(const char *s, struct number_set *set)
>> +{
>> + regex_t preg;
>> + int rc;
>> +
>> + if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0) {
>> + size_t len = regerror(rc, &preg, NULL, 0);
>> + char buf[len];
>
>We don't use VLA on the stack, it is not portable.  In particular,
>it won't pass travis-ci clang tests.  If you've pushed it to github
>and enabled travis-ci, you'd have noticed.

Ok, I replace it with alloca. But it pass travis-ci clang tests [1],
and strace have similar code in socketutils.c:152.

>
>Why do you need it here?

The length of buffer is unknown, len return by first regerror call.

[1]https://travis-ci.org/ppiao/strace/builds/22134567

JingPiao Chen
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to