* [Bug pending/19514] bogus warning about complex "integer" types from typedef
2005-01-18 22:02 [Bug pending/19514] New: bogus warning about complex "integer" types from typedef gcc-bugzilla at gcc dot gnu dot org
@ 2005-01-18 22:20 ` joseph at codesourcery dot com
2005-01-18 22:53 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: joseph at codesourcery dot com @ 2005-01-18 22:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From joseph at codesourcery dot com 2005-01-18 22:20 -------
Subject: Re: New: bogus warning about complex "integer"
types from typedef
On Tue, 18 Jan 2005, gcc-bugzilla at gcc dot gnu dot org wrote:
> When compiling the following two lines:
>
> typedef double R;
> typedef R _Complex C;
This is not valid code; you can't use _Complex together with a typedef,
only together with "float", "double" or "long double" in one of the forms
listed in C99.
The misleading diagnostic is a bug, which has been fixed in mainline: you
now get the error
t.c:2: error: two or more data types in declaration specifiers
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19514
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug pending/19514] bogus warning about complex "integer" types from typedef
2005-01-18 22:02 [Bug pending/19514] New: bogus warning about complex "integer" types from typedef gcc-bugzilla at gcc dot gnu dot org
2005-01-18 22:20 ` [Bug pending/19514] " joseph at codesourcery dot com
@ 2005-01-18 22:53 ` pinskia at gcc dot gnu dot org
2005-01-18 22:57 ` stevenj at fftw dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-18 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-18 22:52 -------
Invalid based on JSM's comment.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19514
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug pending/19514] bogus warning about complex "integer" types from typedef
2005-01-18 22:02 [Bug pending/19514] New: bogus warning about complex "integer" types from typedef gcc-bugzilla at gcc dot gnu dot org
2005-01-18 22:20 ` [Bug pending/19514] " joseph at codesourcery dot com
2005-01-18 22:53 ` pinskia at gcc dot gnu dot org
@ 2005-01-18 22:57 ` stevenj at fftw dot org
2005-01-18 23:15 ` stevenj at fftw dot org
2005-01-18 23:53 ` joseph at codesourcery dot com
4 siblings, 0 replies; 6+ messages in thread
From: stevenj at fftw dot org @ 2005-01-18 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From stevenj at fftw dot org 2005-01-18 22:56 -------
Subject: Re: bogus warning about complex "integer" types
from typedef
On Tue, 18 Jan 2005, joseph at codesourcery dot com wrote:
>> typedef double R;
>> typedef R _Complex C;
>
> This is not valid code; you can't use _Complex together with a typedef,
> only together with "float", "double" or "long double" in one of the forms
> listed in C99.
My copy of the C99 draft standard states (sec. 6.7.7):
"A typedef declaration does not introduce a new type, only a
synonym for the type so specified."
According to this, "R complex" should be a synonym for "double complex",
and therefore should be valid code. What justification do you have for
claiming otherwise?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19514
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug pending/19514] bogus warning about complex "integer" types from typedef
2005-01-18 22:02 [Bug pending/19514] New: bogus warning about complex "integer" types from typedef gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-18 22:57 ` stevenj at fftw dot org
@ 2005-01-18 23:15 ` stevenj at fftw dot org
2005-01-18 23:53 ` joseph at codesourcery dot com
4 siblings, 0 replies; 6+ messages in thread
From: stevenj at fftw dot org @ 2005-01-18 23:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From stevenj at fftw dot org 2005-01-18 23:15 -------
Subject: Re: bogus warning about complex "integer" types
from typedef
Okay, I guess I see what you mean. "double" in "double _Complex" is
arguably not a "type", but rather a type-specifier as defined in 6.7.2,
and the "each list of type-specifiers shall be one of the following sets",
a prescribed list of combinations that does not include typedefs.
What an annoyance; one has to define R via the preprocessor, then, in
order to use consistent floating-point precisions everywhere in a program.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19514
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug pending/19514] bogus warning about complex "integer" types from typedef
2005-01-18 22:02 [Bug pending/19514] New: bogus warning about complex "integer" types from typedef gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-01-18 23:15 ` stevenj at fftw dot org
@ 2005-01-18 23:53 ` joseph at codesourcery dot com
4 siblings, 0 replies; 6+ messages in thread
From: joseph at codesourcery dot com @ 2005-01-18 23:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From joseph at codesourcery dot com 2005-01-18 23:52 -------
Subject: Re: bogus warning about complex "integer" types
from typedef
On Tue, 18 Jan 2005, stevenj at fftw dot org wrote:
> Okay, I guess I see what you mean. "double" in "double _Complex" is
> arguably not a "type", but rather a type-specifier as defined in 6.7.2,
> and the "each list of type-specifiers shall be one of the following sets",
> a prescribed list of combinations that does not include typedefs.
Yes, that's my point. "double _Complex" is one valid list of type
specifiers. "typedef name" is another, listed separately - a single type
specifier, not part of any valid combinations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19514
^ permalink raw reply [flat|nested] 6+ messages in thread