Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler.pri: use -std=c++98 instead of -std=c++03. #2588

Merged
merged 1 commit into from Oct 26, 2016

Conversation

@mkrautz
Copy link
Member

commented Oct 22, 2016

GCC 4.1, used in our CentOS 5 buildenv doesn't know
the c++03 alias. Use c++98 instead.

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Oct 22, 2016

PTAL

@@ -248,10 +248,10 @@ unix {
}
} else {
# If C++11 support hasn't been explicitly enabled,
# force C++03 mode. If we don't do this, newer
# force C++98/C++03 mode. If we don't do this, newer

This comment has been minimized.

Copy link
@Kissaki

Kissaki Oct 22, 2016

Member

Mh? We changed to 98 below, so why do we still mention 03?

This comment has been minimized.

Copy link
@hacst

hacst Oct 23, 2016

Member

Because we don't actually program C++98 ;) We assume C++03 semantics and would crash and burn if someone would interpret C++98 maliciously (which probably no compiler/stdlib does but still....).

Imho the comment ought to mention that we just use C++98 as a workaround for legacy gcc use (with that gcc actually being already C++03 compliant in that mode from what I can gather). Our actual target is still C++03.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 23, 2016

Author Member

Well, it's not really a "workaround". For GCC, -std=c++98 == -std=c++03 == -ansi. They mean the same thing (according to the Debian man page, at least). It's just that GCC 4.1 doesn't have the -std=c++03 alias, so we have to do this for older stuff.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 23, 2016

Author Member

But I will mention the fact that we use -std=c++98 to support older compilers, and that newer compilers treat -std=c++98 == -std=c++03 == -ansi.

compiler.pri: use -std=c++98 instead of -std=c++03.
GCC 4.1, used in our CentOS 5 buildenv doesn't know
the c++03 alias. Use c++98 instead.

This is completely safe, since there is no semantic
difference between -std=c++98 and -std=c++03.
GCC treats all of "-std=c++98", "-std=c++03" and
"-ansi" as being equal. From the GCC docs:

  "The original ISO C++ standard was published
   as the ISO standard (ISO/IEC 14882:1998) and
   amended by a Technical Corrigenda published
   in 2003 (ISO/IEC 14882:2003).

   These standards are referred to as C++98 and
   C++03, respectively. GCC implements the majority
   of C++98 (export is a notable exception) and most
   of the changes in C++03.

   To select this standard in GCC, use one of the
   options -ansi, -std=c++98, or -std=c++03 [...]"

(Via https://gcc.gnu.org/onlinedocs/gcc/Standards.html)

@mkrautz mkrautz force-pushed the mkrautz:compiler-pri-c++98 branch from 215b24e to 509d7fd Oct 26, 2016

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Oct 26, 2016

PTAL. I've added a more descriptive commit summary, and also amended the comment above -std=c++98.

@Kissaki
Copy link
Member

left a comment

LGTM

@Kissaki Kissaki merged commit 76b95d1 into mumble-voip:master Oct 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.