[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden)
From: |
trueroad |
Subject: |
Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden) |
Date: |
Sat, 01 Feb 2020 00:04:36 -0800 |
Reviewers: lemzwerg,
Message:
On 2020/02/01 07:10:17, lemzwerg wrote:
> Mhmm, wouldn't it be better to simply define `M_PI` if it is not
defined? GNU
> options might not be available with other compilers...
`-std=c++11` cannot use not only `M_PI` but also POSIX functions such as
`strdup ()`.
Even if we define `M_PI`, an error raises since there is no `strdup ()`.
Description:
Fix C++11 option
On the Linux environments,
`M_PI` definition can be used with the `-std=c++11` option.
However, on the other environments (e.g. MinGW),
`M_PI` cannot be used with the `-std=c++11` option.
Originally `-std=c++11` is an option to follow the strict C++ standard,
and cannot use `M_PI` that is not in the C++ standard.
To use `M_PI`, `-std=gnu++11` instead of `-std=c++11` is required.
Also, the current default for g++ is `-std=gnu++14`, not `-std=c++14`.
Please review this at https://codereview.appspot.com/579270051/
Affected files (+1, -1 lines):
M stepmake/stepmake/c++-vars.make
Index: stepmake/stepmake/c++-vars.make
diff --git a/stepmake/stepmake/c++-vars.make b/stepmake/stepmake/c++-vars.make
index
73dd91e240170d11f7736424e7da81ba6c21453a..e7bf19217d3e45dbbdb27e92a7c16013c3c50d6f
100644
--- a/stepmake/stepmake/c++-vars.make
+++ b/stepmake/stepmake/c++-vars.make
@@ -14,7 +14,7 @@ DO_O_DEP = rm -f $(o-dep-out);
DEPENDENCIES_OUTPUT="$(o-dep-out) $(outdir)/$(not
lo-dep-out = $(outdir)/$(subst .lo,.dep,$(notdir $@))#
DO_LO_DEP = rm -f $(lo-dep-out); DEPENDENCIES_OUTPUT="$(lo-dep-out)
$(outdir)/$(notdir $@)"
-EXTRA_CXXFLAGS = -std=c++11 -W -Wall -Wconversion -Woverloaded-virtual
+EXTRA_CXXFLAGS = -std=gnu++11 -W -Wall -Wconversion -Woverloaded-virtual
#ifeq ($(MY_PATCH_LEVEL),)
#EXTRA_CXXFLAGS += -Werror
#endif
- Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), lemzwerg, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden),
trueroad <=
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), nine . fierce . ballads, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), nine . fierce . ballads, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), nine . fierce . ballads, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), trueroad, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), nine . fierce . ballads, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), nine . fierce . ballads, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), lemzwerg, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), trueroad, 2020/02/01
- Re: Issue 5720: Fix C++11 option (issue 579270051 by address@hidden), lemzwerg, 2020/02/02