[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memo: Re: Use of deprecated C++ in DDD
From: |
Arnaud Desitter |
Subject: |
Re: Memo: Re: Use of deprecated C++ in DDD |
Date: |
Wed, 05 Sep 2001 14:38:34 +0100 |
Hi,
andrew.marlow@hsbcib.com wrote:
>
> >> I am trying to build DDD on HPUX 10.20B using aCC and have
> >
> >Which version of aCC ?
>
> aCC: HP ANSI C++ B3910B A.01.23
>
> >
> >> come across several compiler warnings about the use of
> >> file-scoped static. The compiler says it is ignoring the storage class
> >> directive. This is a warning, not an error, so the build proceeds but the
> >
> >Are you talking about warning related to code such as
> >
> >extern "C" {
> > static void foo(){}
> >}
> >
> >?
>
> The ones I noticed were for exit.C.
> Lines 594, 599, 800 and 813 are exactly as you say and you are right.
> The compiler is wrong but the condition can be ignored.
> However, it also warns about line 845 inside the routine ddd_x_error.
> Ignoring the directive in this case will lead to wrong behaviour
> the next time ddd_x_error is called and recovered_from_x_error is false.
> So I think my concern is valid.
>
> >aCC complains unduly as it doesn't implement standard C++ properly
> >in that respect. See Section 9.2.5 of The C++ Programming Language
> >by B. Stroustrup.
> No suprises there. It is a COMMERCIAL compiler after all. Sigh.
I know of only compiler implemting that rule: Sun CC 5.x.
>
> >
> >> executable will not work properly. I understand that file-scoped static
> >
> >Not true IMO. Can you elaborate ? And can you provide an example ?
>
> Hopefully the example above will suffice. I had a quick look through
> all the errors and the one in exit.C at line 845 is the only one
> for a static variable. The others are for static subroutines.
> The message from the compiler is:
>
> Warning 495: "exit.C", line 845 # The linkage directive is ignored for an
> object
> or function declared static.
> static bool entered = false;
> ^^^^^^^
"Linkage" relates to "extern "C"", not to "static" (which is in that
context the
storage directive,see 7.1.2, TC++PL). Therefore I think that the code
is generated
properly.
Can you comment out the related extern "C" and confirm that the warning
emitted by
aCC disappears ?
Regards,
Arnaud
>
> Regards,
>
> Andrew M.
>
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Memo: Re: Use of deprecated C++ in DDD,
Arnaud Desitter <=