<div dir="ltr"><div><font face="monospace, monospace" size="1">vharron@tifa:~$ gcc foo.cpp</font></div><div><font face="monospace, monospace" size="1">foo.cpp: In function ‘int main(int, const char**, const char**)’:</font></div><div><font face="monospace, monospace" size="1">foo.cpp:5:43: error: ‘REG_ENHANCED’ was not declared in this scope</font></div><div><font face="monospace, monospace" size="1"> #define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)</font></div><div><font face="monospace, monospace" size="1"> ^</font></div><div><font face="monospace, monospace" size="1">foo.cpp:11:36: note: in expansion of macro ‘DEFAULT_REG_FLAGS’</font></div><div><font face="monospace, monospace" size="1"> int err = regcomp (&re, "^a$", DEFAULT_REG_FLAGS);</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><div><font face="monospace, monospace" size="1">vharron@tifa:~$ clang foo.cpp</font></div><div><font face="monospace, monospace" size="1">foo.cpp:11:36: error: use of undeclared identifier 'REG_ENHANCED'</font></div><div><font face="monospace, monospace" size="1"> int err = regcomp (&re, "^a$", DEFAULT_REG_FLAGS);</font></div><div><font face="monospace, monospace" size="1"> ^</font></div><div><font face="monospace, monospace" size="1">foo.cpp:5:43: note: expanded from macro 'DEFAULT_REG_FLAGS'</font></div><div><font face="monospace, monospace" size="1">#define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)</font></div><div><font face="monospace, monospace" size="1"> ^</font></div><div><font face="monospace, monospace" size="1">foo.cpp:14:51: error: use of undeclared identifier 'REG_ENHANCED'</font></div><div><font face="monospace, monospace" size="1"> err = regexec (&re, regex_input, 0, NULL, DEFAULT_REG_FLAGS);</font></div><div><font face="monospace, monospace" size="1"> ^</font></div><div><font face="monospace, monospace" size="1">foo.cpp:5:43: note: expanded from macro 'DEFAULT_REG_FLAGS'</font></div><div><font face="monospace, monospace" size="1">#define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)</font></div><div><font face="monospace, monospace" size="1"> ^</font></div><div><font face="monospace, monospace" size="1">2 errors generated.</font></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 3:37 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
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...<br>
<br>
<br>
<br>
#include <stdio.h><br>
#include <stdint.h><br>
#include <regex.h><br>
<br>
#define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)<br>
<br>
int main (int argc, char const *argv[], char const *envp[])<br>
{<br>
regex_t re;<br>
const char *regex_input = "a";<br>
int err = regcomp (&re, "^a$", DEFAULT_REG_FLAGS);<br>
if (err == 0)<br>
{<br>
err = regexec (&re, regex_input, 0, NULL, DEFAULT_REG_FLAGS);<br>
if (err == 0)<br>
{<br>
puts("matched");<br>
}<br>
else<br>
{<br>
char error_str[2048];<br>
const size_t actual_error_str_size = regerror(err, &re, error_str, sizeof(error_str));<br>
puts(error_str);<br>
}<br>
}<br>
return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><br><table cellspacing="0" cellpadding="0" style="font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Vince Harron |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Technical Lead Manager |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 858-442-0868</td></tr></tbody></table><br></div></div>
</div>