zeusdeux / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

POSIX used as an enum value name is very collision prone #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In re2/re2.h there is this snippet:

  enum CannedOptions {
    DefaultOptions = 0,
    Latin1, // treat input as Latin-1 (default UTF-8)
    POSIX, // POSIX syntax, leftmost-longest match
    Quiet // do not log about regexp parse errors
  };

In e.g. Chromium build, POSIX is a defined preprocessor symbol, causing trouble.

It would be cool to rename it, see 
http://src.chromium.org/viewvc/chrome/trunk/src/third_party/re2/patches/rename-p
osix-option.patch?view=markup

Original issue reported on code.google.com by phajdan.jr@chromium.org on 2 Jan 2013 at 11:09

GoogleCodeExporter commented 9 years ago
Somehow this hasn't come up before in any other uses. Given that, I'd
prefer not to change the public RE2 API. If you need to patch RE2 when
importing it into Chromium that seems fine. Arguably Chromium should
be using a less broad #define too.

Russ

Original comment by rsc@golang.org on 4 Jan 2013 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by rsc@golang.org on 4 Jan 2013 at 3:26