You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling gtest and using it with -ansi -pedantic won't compile on Linux.
What steps will reproduce the problem?
1. CXXFLAGS="-ansi -pedantic" ./configure
2. make
3.
What is the expected output? What do you see instead?
It fails with:
g++ -DHAVE_CONFIG_H -I. -I./build-aux -I. -I./include -pthread
-DGTEST_HAS_PTHREAD=1 -ansi -pedantic -MT src/gtest-all.lo -MD -MP -MF
src/.deps/gtest-all.Tpo -c src/gtest-all.cc -fPIC -DPIC -o
src/.libs/gtest-all.o
In file included from ./include/gtest/gtest.h:64,
from src/gtest-all.cc:39:
./include/gtest/gtest-typed-test.h:239:46: warning: anonymous variadic macros
were introduced in C99
In file included from ./include/gtest/internal/gtest-internal.h:40,
from ./include/gtest/gtest.h:57,
from src/gtest-all.cc:39:
./include/gtest/internal/gtest-port.h:1260: error: ISO C++ 1998 does not
support ‘long long’
./include/gtest/internal/gtest-port.h:1448: error: ISO C++ 1998 does not
support ‘long long’
./include/gtest/internal/gtest-port.h:1449: error: ISO C++ 1998 does not
support ‘long long’
In file included from ./src/gtest.cc:128,
from src/gtest-all.cc:42:
./src/gtest-internal-inl.h: In function ‘bool
testing::internal::ParseNaturalNumber(const std::string&, Integer*)’:
./src/gtest-internal-inl.h:1030: error: ISO C++ 1998 does not support ‘long
long’
make: *** [src/gtest-all.lo] Error 1
What version of Google Test are you using? On what operating system?
gtest1.5 on Linux
$ g++ --version
g++ (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
The attached simple patch fixes the problem.
Original issue reported on code.google.com by jens.k.mueller@gmail.com on 22 Nov 2010 at 1:22
I am also seeing this issue. It is because when -pedantic is used the C++98 compiler is not allowed to use preprocessor features from C99. That includes the feature of anonymous variadic macros.
Original issue reported on code.google.com by
jens.k.mueller@gmail.com
on 22 Nov 2010 at 1:22Attachments:
The text was updated successfully, but these errors were encountered: