This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: complex support when using -std=c++11
- From: D Haley <mycae at gmx dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 15 Nov 2015 21:09:11 +0000
- Subject: Re: complex support when using -std=c++11
- Authentication-results: sourceware.org; auth=none
- References: <5644D64F dot 7060400 at gmx dot com> <alpine dot DEB dot 2 dot 20 dot 1511122019530 dot 2044 at laptop-mg dot saclay dot inria dot fr>
Dear Marc,
Thanks for the prompt reply. I am not an expert here, so I probably
don't know the correct solution for gcc. We are using std=c++11 to
maximise source compatibility for any users seeking to recompile our
code on whatever compiler/toolchain they have.
As to your suggestions for possible fixes, my thoughts are as follows:
> * _Complex_I is defined as (__extension__ 1.0iF). Maybe __extension__
> could imply -fext-numeric-literals?
I am unsure if such extensions might cause problems elsewhere due to
preprocessor substitution. This would be my concern here.
> * glibc could define _Complex_I some other way, or libstdc++ could
> redefine it to some other safer form (for some reason __builtin_complex
> is currently C-only).
This seems totally reasonable, but as an end-user , I am not certain if
this can be achieved within the specifications. It sounds good though.
Thanks!