This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/129: Re: Unsolicited warnings



>Number:         129
>Category:       c++
>Synopsis:       __extension__ ignored in template
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          analyzed
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 23 11:26:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Enrico Scholz <Enrico.Scholz@informatik.tu-chemnitz.de>
>Release:        2.95.2
>Organization:
>Environment:
>Description:
 Original-Message-ID: <m38zzavvd1.fsf@kosh.ultra.csn.tu-chemnitz.de>

 While compiling the code shown below, g++ gives out a warning
 "straits.h:86: warning: ANSI C++ forbids variable-size array `a'" whose
 origin I can not understand and which I like to suppress. AFAIK
 variable-sized arrays are an extension and should not be criticized
 there. I have tried to prefix straits.h:86 with __extension__ too but it
 doesn't help.

 [MvL: example changed from original code, error is now
  b.cc: In function `void foo<int>(int)':
  b.cc:9:   instantiated from here
  b.cc:4: warning: ANSI C++ does not support `long long'
 ]

>How-To-Repeat:
template<class T>
void foo(T)
{
  __extension__ long long x;
}

int main()
{
  foo(3);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]