You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@epam.com> on 2007/03/26 20:07:34 UTC
RE: svn commit: r521934 - /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
> -----Original Message-----
> From: sebor@apache.org [mailto:sebor@apache.org]
> Sent: Saturday, March 24, 2007 1:10 AM
> To: stdcxx-commits@incubator.apache.org
> Subject: svn commit: r521934 -
> /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
>
> Author: sebor
> Date: Fri Mar 23 16:09:40 2007
> New Revision: 521934
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=521934
> Log:
> 2007-03-23 Martin Sebor <se...@roguewave.com>
>
[...]
>
> -struct tm foo (struct tm arg)
> +// 7.24.1, p2 of C99: struct tm is required to declared // as an
> +incomplete type in <wchar.h>
> +
> +struct tm* struct_tm_declared (struct tm* arg)
> {
> return arg;
> }
The my gcc 3.4.4 on cygwin and msvc treats the declaration of the
function
struct_tm_declared as the declaration of the type struct tm also.
I have reopened the issue STDCXX-364.
I propose to use using directive for checking the declaration of the
struct tm:
namespace {
using ::tm;
}
Farid.
RE: svn commit: r521934 -/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Farid Zaripov [mailto:Farid_Zaripov@epam.com]
> Sent: Tuesday, March 27, 2007 7:23 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: svn commit: r521934
> -/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
>
> > -----Original Message-----
> > From: Martin Sebor [mailto:msebor@gmail.com]
> > Sent: Tuesday, March 27, 2007 6:00 PM
> > To: stdcxx-dev@incubator.apache.org
> > Subject: RE: svn commit: r521934
> > -/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
> >
> > Can we find another way to trigger the error? How about
> changing the
> > function to:
> >
> > tm* foo (tm *arg) { return arg; }
>
> Yes, it works.
Fixed: http://svn.apache.org/viewvc?view=rev&revision=522993
Farid.
RE: svn commit: r521934 -/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com]
> Sent: Tuesday, March 27, 2007 6:00 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: svn commit: r521934
> -/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
>
> Can we find another way to trigger the error? How about
> changing the function to:
>
> tm* foo (tm *arg) { return arg; }
Yes, it works.
Farid.
RE: svn commit: r521934 -
/incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
Posted by Martin Sebor <ms...@gmail.com>.
On Tue, 2007-03-27 at 17:13 +0300, Farid Zaripov wrote:
> > -----Original Message-----
> > From: Martin Sebor [mailto:sebor@roguewave.com]
> > Sent: Monday, March 26, 2007 10:06 PM
> > To: stdcxx-dev@incubator.apache.org
> > Subject: Re: svn commit: r521934 -
> > /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
> >
> > > The my gcc 3.4.4 on cygwin and msvc treats the declaration of the
> > > function struct_tm_declared as the declaration of the type
> > struct tm
> > > also.
> >
> > I don't understand what you mean. Are you saying the
> > compilers issue an error for the test cases even when struct
> > tm is declared or that they do NOT issue an error when the
> > struct is NOT declared?
> The compiler do not issue an error if struct is not declared.
>
> Moreover, after that declaration type tm can be used in other
> declarations.
>
> The test below compiled without any errors:
Can we find another way to trigger the error? How about changing
the function to:
tm* foo (tm *arg) { return arg; }
Martin
> -----------------
> struct tm* foo (struct tm* arg)
> {
> return arg;
> }
>
> namespace {
> using ::tm;
> }
> -----------------
>
> Farid.
RE: svn commit: r521934 - /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Monday, March 26, 2007 10:06 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r521934 -
> /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
>
> > The my gcc 3.4.4 on cygwin and msvc treats the declaration of the
> > function struct_tm_declared as the declaration of the type
> struct tm
> > also.
>
> I don't understand what you mean. Are you saying the
> compilers issue an error for the test cases even when struct
> tm is declared or that they do NOT issue an error when the
> struct is NOT declared?
The compiler do not issue an error if struct is not declared.
Moreover, after that declaration type tm can be used in other
declarations.
The test below compiled without any errors:
-----------------
struct tm* foo (struct tm* arg)
{
return arg;
}
namespace {
using ::tm;
}
-----------------
Farid.
Re: svn commit: r521934 - /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: sebor@apache.org [mailto:sebor@apache.org]
>> Sent: Saturday, March 24, 2007 1:10 AM
>> To: stdcxx-commits@incubator.apache.org
>> Subject: svn commit: r521934 -
>> /incubator/stdcxx/trunk/etc/config/src/STRUCT_TM_IN_WCHAR_H.cpp
>>
>> Author: sebor
>> Date: Fri Mar 23 16:09:40 2007
>> New Revision: 521934
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=521934
>> Log:
>> 2007-03-23 Martin Sebor <se...@roguewave.com>
>>
> [...]
>>
>> -struct tm foo (struct tm arg)
>> +// 7.24.1, p2 of C99: struct tm is required to declared // as an
>> +incomplete type in <wchar.h>
>> +
>> +struct tm* struct_tm_declared (struct tm* arg)
>> {
>> return arg;
>> }
>
> The my gcc 3.4.4 on cygwin and msvc treats the declaration of the
> function
> struct_tm_declared as the declaration of the type struct tm also.
I don't understand what you mean. Are you saying the compilers
issue an error for the test cases even when struct tm is declared
or that they do NOT issue an error when the struct is NOT declared?
If the former, can you post the error(s)?
In either case, it would help to have a test case for the compiler
bug (assuming it is, in fact, a bug).
>
> I have reopened the issue STDCXX-364.
>
> I propose to use using directive for checking the declaration of the
> struct tm:
>
> namespace {
> using ::tm;
> }
That relies on namespace support in the compiler which we don't
require (this goes back to the discussion about which compiler
features we should be allowed to assume; IIRC, we never decided
on a list).
Before we change how we test for struct tm I'd like to better
understand the problem with the test as it stands.
Martin