[lldb-dev] Can someone compile and run this on Linux?

Vince Harron vharron at google.com
Tue Jan 20 16:06:56 PST 2015


http://www.manpagez.com/man/3/regcomp/

     REG_ENHANCED  Recognized enhanced regular expression features;
see *re_format(7) <http://www.manpagez.com/man/7/re_format/>* for
details.  This is an extension not specified by IEEE Std 1003.2
(``POSIX.2''), and should be used with caution in software intended to
be portable to other systems.


=(



On Tue, Jan 20, 2015 at 3:54 PM, Zachary Turner <zturner at google.com> wrote:

> s/Linus/Linux/
>
>
> On Tue Jan 20 2015 at 3:50:10 PM Zachary Turner <zturner at google.com>
> wrote:
>
>> Linus doesn't appear to have REG_ENHANCED.
>>
>> On Tue, Jan 20, 2015 at 3:37 PM, Greg Clayton <gclayton at apple.com> wrote:
>>
>>> The code below fails to match the string "a" to the regex "^a$" on
>>> MacOSX if both "REG_EXTENDED | REG_ENHANCED" are specified, but it will
>>> pass if just REG_ENHANCED is used.
>>>
>>> Can someone run this on linux to see if the code below fails as well on
>>> linux? I want to make sure it isn't just an old version of regex we have in
>>> our libc...
>>>
>>>
>>>
>>> #include <stdio.h>
>>> #include <stdint.h>
>>> #include <regex.h>
>>>
>>> #define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)
>>>
>>> int main (int argc, char const *argv[], char const *envp[])
>>> {
>>>     regex_t re;
>>>     const char *regex_input = "a";
>>>     int err = regcomp (&re, "^a$", DEFAULT_REG_FLAGS);
>>>     if (err == 0)
>>>     {
>>>         err = regexec (&re, regex_input, 0, NULL, DEFAULT_REG_FLAGS);
>>>         if (err == 0)
>>>         {
>>>             puts("matched");
>>>         }
>>>         else
>>>         {
>>>             char error_str[2048];
>>>             const size_t actual_error_str_size = regerror(err, &re,
>>> error_str, sizeof(error_str));
>>>             puts(error_str);
>>>         }
>>>     }
>>>     return 0;
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>
>>
>>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>


-- 

Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150120/00c6e563/attachment.html>


More information about the lldb-dev mailing list