kokizzu / re2

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

Clang warnings due to using C++11 features in non-C++11 mode. #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to build a project which uses RE2 using Clang
2. Observe as Clang whines about the use of C++11 features without C++11 mode

What is the expected output?

Nothing.

>What do you see instead?

/brew/include/re2/re2.h:243:25: warning: commas at the end of enumerator lists 
are a C++11 extension [-Wc++11-extensions]
/brew/include/re2/re2.h:672:28: warning: 'long long' is a C++11 extension 
[-Wc++11-long-long]
/brew/include/re2/re2.h:840:47: warning: extra ';' outside of a function is a 
C++11 extension [-Wc++11-extra-semi]

What version of the product are you using? On what operating system?

The latest version from Mercurial.

----

My patch will fix all issues apart from the use of long long which can not be 
used unless you are mandating C++11. If this is the case then this should 
probably be documented.

Original issue reported on code.google.com by pet...@saberuk.com on 11 Jun 2013 at 11:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. RE2 definitely does not require C++11, and in fact it avoids many
C++11 features. It's not like there are only C++03 and C++11 compilers.
There are plenty of compilers that have long long but aren't C++11. Clang
is a whiny know-it-all.

It's been a very long time since I encountered a compiler without 'long
long'.

changeset:   101:a8a53b20607f
tag:         tip
user:        Russ Cox <rsc@swtch.com>
date:        Fri Jun 21 15:52:49 2013 -0400
summary:     re2: fix c++11 clang nonsense

Russ

Original comment by rsc@golang.org on 21 Jun 2013 at 7:53